fa3bfd
commit c369d66e5426a30e4725b100d5cd28e372754f90
fa3bfd
Author: Paul Eggert <eggert@cs.ucla.edu>
fa3bfd
Date:   Fri Oct 20 18:41:14 2017 +0200
fa3bfd
fa3bfd
    CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320]
fa3bfd
fa3bfd
diff --git a/posix/glob.c b/posix/glob.c
fa3bfd
index 87d4f1bd2a7ef5a0..15cf3d5cccab0ee0 100644
fa3bfd
--- a/posix/glob.c
fa3bfd
+++ b/posix/glob.c
fa3bfd
@@ -826,7 +826,7 @@ glob (pattern, flags, errfunc, pglob)
fa3bfd
 		  *p = '\0';
fa3bfd
 		}
fa3bfd
 	      else
fa3bfd
-		*((char *) mempcpy (newp, dirname + 1, end_name - dirname))
fa3bfd
+		*((char *) mempcpy (newp, dirname + 1, end_name - dirname - 1))
fa3bfd
 		  = '\0';
fa3bfd
 	      user_name = newp;
fa3bfd
 	    }