summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-10-20 18:41:14 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2017-10-28 01:10:55 +0200
commit338b0180716cbead6d2c7d76554d793273e2c7a3 (patch)
treebef93590edffe81ca992086d7670770084352cd1
parentglob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332] (diff)
downloadglibc-338b0180716cbead6d2c7d76554d793273e2c7a3.tar.gz
glibc-338b0180716cbead6d2c7d76554d793273e2c7a3.tar.bz2
glibc-338b0180716cbead6d2c7d76554d793273e2c7a3.zip
CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320]gentoo/glibc-2.25-12
(cherry picked from commit c369d66e5426a30e4725b100d5cd28e372754f90)
-rw-r--r--posix/glob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/posix/glob.c b/posix/glob.c
index 04adb445d4..c110695e8d 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -843,7 +843,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;
}