diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-08-25 23:42:01 -0700 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2015-08-31 17:47:42 +0200 |
commit | 543ef578c3304661713950b37abd0c916f52ecf0 (patch) | |
tree | 334bfbf6ae30dee99b42083e54904d6ed9627d9e /sysdeps/posix/posix_fallocate.c | |
parent | 3f563e90e85cb378f9f40e6a10bc50b309b39ab1 (diff) | |
download | glibc-543ef578c3304661713950b37abd0c916f52ecf0.tar glibc-543ef578c3304661713950b37abd0c916f52ecf0.tar.gz glibc-543ef578c3304661713950b37abd0c916f52ecf0.tar.bz2 glibc-543ef578c3304661713950b37abd0c916f52ecf0.zip |
Fix broken overflow check in posix_fallocate [BZ 18873]
* sysdeps/posix/posix_fallocate.c (posix_fallocate):
* sysdeps/posix/posix_fallocate64.c (__posix_fallocate64_l64):
Fix parenthesization typo.
Diffstat (limited to 'sysdeps/posix/posix_fallocate.c')
-rw-r--r-- | sysdeps/posix/posix_fallocate.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/posix/posix_fallocate.c b/sysdeps/posix/posix_fallocate.c index e7fe201b68..d0479a6ee5 100644 --- a/sysdeps/posix/posix_fallocate.c +++ b/sysdeps/posix/posix_fallocate.c @@ -37,7 +37,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len) /* Perform overflow check. The outer cast relies on a GCC extension. */ - if ((__off_t) ((uint64_t) offset) + ((uint64_t) len) < 0) + if ((__off_t) ((uint64_t) offset + (uint64_t) len) < 0) return EFBIG; /* pwrite below will not do the right thing in O_APPEND mode. */ |