]> granicus.if.org Git - cracklib/commitdiff
Fix a buffer overflow processing long words
authorJan Dittberner <jan@dittberner.info>
Thu, 25 Aug 2016 15:17:53 +0000 (17:17 +0200)
committerJan Dittberner <jan@dittberner.info>
Thu, 25 Aug 2016 15:17:53 +0000 (17:17 +0200)
A buffer overflow processing long words has been discovered. This commit
applies the patch from
https://build.opensuse.org/package/view_file/Base:System/cracklib/0004-overflow-processing-long-words.patch
by Howard Guo.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835386 and
http://www.openwall.com/lists/oss-security/2016/08/23/8

src/NEWS
src/lib/rules.c

index 361a2074be2e68d88be9509648b6ef9d9795da15..f1df3b09634c84fa5f0256b9220971819102fa8a 100644 (file)
--- a/src/NEWS
+++ b/src/NEWS
@@ -1,4 +1,5 @@
 v2.9.x apply patch to fix CVE-2016-6318 Stack-based buffer overflow when parsing large GECOS field
+       fix a buffer overflow processing long words
 v2.9.6 updates to cracklib-words to add a bunch of other dictionary lists
        migration to github
        patch to add some particularly bad cases to the cracklib small dictionary (Matthew Miller)
index d193cc04b266edb9f445cdbe4159370281a0e5ee..3a2aa46000ecaa67296ee9b0254da5af1364e0b8 100644 (file)
@@ -434,9 +434,8 @@ Mangle(input, control)              /* returns a pointer to a controlled Mangle */
 {
     int limit;
     register char *ptr;
-    static char area[STRINGSIZE];
-    char area2[STRINGSIZE];
-    area[0] = '\0';
+    static char area[STRINGSIZE * 2] = {0};
+    char area2[STRINGSIZE * 2] = {0};
     strcpy(area, input);
 
     for (ptr = control; *ptr; ptr++)