0009-Fix-heap-buffer-overflow.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From d9bcffd6cd5e8ec32889a594f7348d67a5101b3a Mon Sep 17 00:00:00 2001
  2. From: Changqing Li <changqing.li@windriver.com>
  3. Date: Mon, 12 May 2025 13:58:42 +0800
  4. Subject: [PATCH] Fix heap buffer overflow in
  5. soup-content-sniffer.c:sniff_feed_or_html()
  6. CVE: CVE-2025-32053
  7. Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/eaed42ca8d40cd9ab63764e3d63641180505f40a]
  8. Upstream: https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/libsoup/libsoup-2.4/CVE-2025-32053.patch
  9. Signed-off-by: Changqing Li <changqing.li@windriver.com>
  10. Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
  11. ---
  12. libsoup/soup-content-sniffer.c | 4 ++--
  13. 1 file changed, 2 insertions(+), 2 deletions(-)
  14. diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c
  15. index 967ec61..5f2896e 100644
  16. --- a/libsoup/soup-content-sniffer.c
  17. +++ b/libsoup/soup-content-sniffer.c
  18. @@ -620,7 +620,7 @@ skip_insignificant_space (const char *resource, int *pos, int resource_length)
  19. (resource[*pos] == '\x0D')) {
  20. *pos = *pos + 1;
  21. - if (*pos > resource_length)
  22. + if (*pos >= resource_length)
  23. return TRUE;
  24. }
  25. @@ -682,7 +682,7 @@ sniff_feed_or_html (SoupContentSniffer *sniffer, SoupBuffer *buffer)
  26. do {
  27. pos++;
  28. - if (pos > resource_length)
  29. + if ((pos + 1) > resource_length)
  30. goto text_html;
  31. } while (resource[pos] != '>');
  32. --
  33. 2.34.1