]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320]
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 20 Oct 2017 16:41:14 +0000 (18:41 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 2 Dec 2017 21:50:14 +0000 (22:50 +0100)
(cherry picked from commit c369d66e5426a30e4725b100d5cd28e372754f90)

ChangeLog
NEWS
posix/glob.c

index 7d47dd8d7d5737b8dc210fb06dfa94757e8da346..5229661ab1ae02ef16af10b2d41007427ad614ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-20  Paul Eggert <eggert@cs.ucla.edu>
+
+       [BZ #22320]
+       CVE-2017-15670
+       * posix/glob.c (__glob): Fix one-byte overflow.
+
 2017-09-08  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
        [BZ #1062]
diff --git a/NEWS b/NEWS
index 9a9e487ee689934c4a321f214fa999c7be8b74d1..8c10e88ec51e452a36b10955b7606429393a67df 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,10 @@ Security related changes:
   question type which is outside the range of valid question type values.
   (CVE-2015-5180)
 
+* CVE-2017-15670: The glob function, when invoked with GLOB_TILDE, suffered
+  from a one-byte overflow during ~ operator processing (either on the stack
+  or the heap, depending on the length of the user name).
+
 The following bugs are resolved with this release:
 
   [20790] Fix rpcgen buffer overrun
index ea6a2402090378c32eef7b3ca93b48aeea32962d..026bc063d3a046be5f9c8636ba1fcfe59dcc423b 100644 (file)
@@ -883,7 +883,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
                  *p = '\0';
                }
              else
-               *((char *) mempcpy (newp, dirname + 1, end_name - dirname))
+               *((char *) mempcpy (newp, dirname + 1, end_name - dirname - 1))
                  = '\0';
              user_name = newp;
            }