diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2015-11-03 17:27:24 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2015-11-03 17:27:24 +0000 |
| commit | 0755c175008c946986457706950acadf9d762458 (patch) | |
| tree | 7daab7fcff9ca368bae74597d4dae944ff7bb82a /usr.bin/bsdiff | |
| parent | 8e7baabc9fe7b5d5afe5df8ca9bcf60b5e1a2bc0 (diff) | |
Notes
Diffstat (limited to 'usr.bin/bsdiff')
| -rw-r--r-- | usr.bin/bsdiff/bsdiff/bsdiff.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/bsdiff/bsdiff/bsdiff.c b/usr.bin/bsdiff/bsdiff/bsdiff.c index db0bf69e238c..7e39275a0a46 100644 --- a/usr.bin/bsdiff/bsdiff/bsdiff.c +++ b/usr.bin/bsdiff/bsdiff/bsdiff.c @@ -237,7 +237,8 @@ int main(int argc,char *argv[]) err(1, "%s", argv[1]); if (oldsize > SSIZE_MAX || - (uintmax_t)oldsize >= SIZE_T_MAX / sizeof(off_t)) { + (uintmax_t)oldsize >= SIZE_T_MAX / sizeof(off_t) || + oldsize == OFF_MAX) { errno = EFBIG; err(1, "%s", argv[1]); } @@ -260,7 +261,8 @@ int main(int argc,char *argv[]) ((newsize=lseek(fd,0,SEEK_END))==-1)) err(1, "%s", argv[2]); - if (newsize > SSIZE_MAX || (uintmax_t)newsize >= SIZE_T_MAX) { + if (newsize > SSIZE_MAX || (uintmax_t)newsize >= SIZE_T_MAX || + newsize == OFF_MAX) { errno = EFBIG; err(1, "%s", argv[2]); } |
