36 lines
1013 B
Diff
36 lines
1013 B
Diff
From 8e1793e2ddd8c2648b9a28f06bf21fd13bd12b39 Mon Sep 17 00:00:00 2001
|
|
From: Ar Jun <pkillarjun@protonmail.com>
|
|
Date: Mon, 18 Nov 2024 14:59:51 -0600
|
|
Subject: [PATCH] Fix heap buffer overflow in
|
|
soup-content-sniffer.c:sniff_feed_or_html()
|
|
|
|
---
|
|
libsoup/soup-content-sniffer.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c
|
|
index 26c65bbd..698d05e4 100644
|
|
--- a/libsoup/soup-content-sniffer.c
|
|
+++ b/libsoup/soup-content-sniffer.c
|
|
@@ -620,7 +620,7 @@ skip_insignificant_space (const char *resource, int *pos, int resource_length)
|
|
(resource[*pos] == '\x0D')) {
|
|
*pos = *pos + 1;
|
|
|
|
- if (*pos > resource_length)
|
|
+ if (*pos >= resource_length)
|
|
return TRUE;
|
|
}
|
|
|
|
@@ -682,7 +682,7 @@ sniff_feed_or_html (SoupContentSniffer *sniffer, SoupBuffer *buffer)
|
|
do {
|
|
pos++;
|
|
|
|
- if (pos > resource_length)
|
|
+ if ((pos + 1) > resource_length)
|
|
goto text_html;
|
|
} while (resource[pos] != '>');
|
|
|
|
--
|
|
2.49.0
|
|
|