The branch main has been updated by kevans:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b61758494286db075d5c6b68a5f2e7522e7be394

commit b61758494286db075d5c6b68a5f2e7522e7be394
Author:     Kyle Evans <[email protected]>
AuthorDate: 2023-03-09 05:53:10 +0000
Commit:     Kyle Evans <[email protected]>
CommitDate: 2023-03-09 05:53:10 +0000

    grep: remove tautological condition
    
    st_size is an off_t, it cannot hold values larger than OFF_MAX.
    
    CID:            1008931
---
 usr.bin/grep/file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c
index 8577572c2887..787e8fbe03bb 100644
--- a/usr.bin/grep/file.c
+++ b/usr.bin/grep/file.c
@@ -186,8 +186,7 @@ grep_open(const char *path)
        if (filebehave == FILE_MMAP) {
                struct stat st;
 
-               if ((fstat(f->fd, &st) == -1) || (st.st_size > OFF_MAX) ||
-                   (!S_ISREG(st.st_mode)))
+               if (fstat(f->fd, &st) == -1 || !S_ISREG(st.st_mode))
                        filebehave = FILE_STDIO;
                else {
                        int flags = MAP_PRIVATE | MAP_NOCORE | MAP_NOSYNC;

Reply via email to