0002-Fix-a-buffer-overflow-processing-long-words.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 33d7fa4585247cd2247a1ffa032ad245836c6edb Mon Sep 17 00:00:00 2001
  2. From: Jan Dittberner <jan@dittberner.info>
  3. Date: Thu, 25 Aug 2016 17:17:53 +0200
  4. Subject: [PATCH] Fix a buffer overflow processing long words
  5. A buffer overflow processing long words has been discovered. This commit
  6. applies the patch from
  7. https://build.opensuse.org/package/view_file/Base:System/cracklib/0004-overflow-processing-long-words.patch
  8. by Howard Guo.
  9. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835386 and
  10. http://www.openwall.com/lists/oss-security/2016/08/23/8
  11. Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
  12. ---
  13. Status: upstream, not yet released.
  14. lib/rules.c | 5 ++---
  15. 2 files changed, 3 insertions(+), 3 deletions(-)
  16. diff --git a/lib/rules.c b/lib/rules.c
  17. index d193cc0..3a2aa46 100644
  18. --- a/lib/rules.c
  19. +++ b/lib/rules.c
  20. @@ -434,9 +434,8 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
  21. {
  22. int limit;
  23. register char *ptr;
  24. - static char area[STRINGSIZE];
  25. - char area2[STRINGSIZE];
  26. - area[0] = '\0';
  27. + static char area[STRINGSIZE * 2] = {0};
  28. + char area2[STRINGSIZE * 2] = {0};
  29. strcpy(area, input);
  30. for (ptr = control; *ptr; ptr++)
  31. --
  32. 2.9.3