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

1234567891011121314151617181920212223242526272829303132333435
  1. From f4a67a9a3033586edaee715d40d5992e02d32893 Mon Sep 17 00:00:00 2001
  2. From: Patrick Griffis <pgriffis@igalia.com>
  3. Date: Sat, 16 Nov 2024 12:07:30 -0600
  4. Subject: [PATCH] Fix heap buffer overflow in soup_content_sniffer_sniff
  5. Co-Author: Ar Jun <pkillarjun@protonmail.com>
  6. CVE: CVE-2025-32052
  7. Upstream-Status: Backport
  8. [https://gitlab.gnome.org/GNOME/libsoup/-/commit/f182429e5b1fc034050510da20c93256c4fa9652#500da7cfde649872c49169be34b03a1c42a53ddb]
  9. Upstream: https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/libsoup/libsoup-2.4/CVE-2025-32052.patch
  10. Signed-off-by: Changqing Li <changqing.li@windriver.com>
  11. Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
  12. ---
  13. libsoup/soup-content-sniffer.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c
  16. index 9554636..eac9e7b 100644
  17. --- a/libsoup/soup-content-sniffer.c
  18. +++ b/libsoup/soup-content-sniffer.c
  19. @@ -504,7 +504,7 @@ sniff_unknown (SoupContentSniffer *sniffer, SoupBuffer *buffer,
  20. guint index_pattern = 0;
  21. gboolean skip_row = FALSE;
  22. - while ((index_stream < resource_length) &&
  23. + while ((index_stream < resource_length - 1) &&
  24. (index_pattern <= type_row->pattern_length)) {
  25. /* Skip insignificant white space ("WS" in the spec) */
  26. if (type_row->pattern[index_pattern] == ' ') {
  27. --
  28. 2.34.1