0006-Fix-buffer-overflow-in-string_vformat.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 478effbfd9c3cc5a627fc671d4bf94d13670d65f Mon Sep 17 00:00:00 2001
  2. From: Jeremy Harris <jgh146exb@wizmail.org>
  3. Date: Fri, 27 Sep 2019 12:21:49 +0100
  4. Subject: [PATCH] Fix buffer overflow in string_vformat. Bug 2449
  5. Fixes CVE-2019-16928:
  6. https://lists.exim.org/lurker/message/20190928.003428.2b4c81a7.en.html
  7. Downloaded from upstream commit
  8. https://git.exim.org/exim.git/patch/478effbfd9c3cc5a627fc671d4bf94d13670d65f
  9. [adjusted patch of string.c and removed patches for test/]
  10. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  11. ---
  12. src/string.c | 4 ++--
  13. scripts/0000-Basic/0214 | 11 +++++++++++
  14. stdout/0214 | 7 +++++++
  15. 3 files changed, 20 insertions(+), 2 deletions(-)
  16. diff --git a/src/src/string.c b/src/src/string.c
  17. index c6549bf..3445f8a 100644
  18. --- a/src/string.c
  19. +++ b/src/string.c
  20. @@ -1132,7 +1132,7 @@ store_reset(g->s + (g->size = g->ptr + 1));
  21. Arguments:
  22. g the growable-string
  23. p current end of data
  24. - count amount to grow by
  25. + count amount to grow by, offset from p
  26. */
  27. static void
  28. @@ -1590,7 +1590,7 @@ while (*fp)
  29. }
  30. else if (g->ptr >= lim - width)
  31. {
  32. - gstring_grow(g, g->ptr, width - (lim - g->ptr));
  33. + gstring_grow(g, g->ptr, width);
  34. lim = g->size - 1;
  35. gp = CS g->s + g->ptr;
  36. }
  37. --
  38. 1.9.1