]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix broken overflow check in posix_fallocate [BZ 18873]
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 26 Aug 2015 06:42:01 +0000 (23:42 -0700)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 31 Aug 2015 15:47:42 +0000 (17:47 +0200)
* sysdeps/posix/posix_fallocate.c (posix_fallocate):
* sysdeps/posix/posix_fallocate64.c (__posix_fallocate64_l64):
Fix parenthesization typo.

ChangeLog
NEWS
sysdeps/posix/posix_fallocate.c
sysdeps/posix/posix_fallocate64.c

index 99129d39a5684c41255897607f65075b30754a4b..09224e91d5604418b34178283462b91163b7f76f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-08-31  Paul Eggert  <eggert@cs.ucla.edu>
+
+       [BZ #18873]
+       Fix broken overflow check in posix_fallocate
+       * sysdeps/posix/posix_fallocate.c (posix_fallocate):
+       * sysdeps/posix/posix_fallocate64.c (__posix_fallocate64_l64):
+       Fix parenthesization typo.
+
 2015-08-28  Mike Frysinger  <vapier@gentoo.org>
 
        [BZ #18887]
diff --git a/NEWS b/NEWS
index e91d669608534b7209d626b8963f6fad297081aa..20fa6ac0000e55a5f229c94142b7caed8e1a306f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,7 @@ Version 2.23
   2898, 14341, 15786, 16141, 16517, 16519, 16520, 16734, 16973, 17787,
   17905, 18084, 18086, 18240, 18265, 18370, 18421, 18480, 18525, 18610,
   18618, 18647, 18661, 18674, 18681, 18778, 18781, 18787, 18789, 18790,
-  18795, 18796, 18820, 18823, 18824, 18863, 18887.
+  18795, 18796, 18820, 18823, 18824, 18863, 18873, 18887.
 
 * The obsolete header <regexp.h> has been removed.  Programs that require
   this header must be updated to use <regex.h> instead.
index e7fe201b682c787af33ae2b7c7533a81e0848499..d0479a6ee57c067c4360bfdbbe344907e9d75f89 100644 (file)
@@ -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.  */
index ee32679a05b48d3498e478d9947ec8c28332919e..fb2dac6e1341938034b7a3ea09d4409d0f26aab1 100644 (file)
@@ -37,7 +37,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
 
   /* Perform overflow check.  The outer cast relies on a GCC
      extension.  */
-  if ((__off64_t) ((uint64_t) offset) + ((uint64_t) len) < 0)
+  if ((__off64_t) ((uint64_t) offset + (uint64_t) len) < 0)
     return EFBIG;
 
   /* pwrite64 below will not do the right thing in O_APPEND mode.  */