27 lines
973 B
Diff
27 lines
973 B
Diff
From 1542173d11df64e39e71367f10596e8160481290 Mon Sep 17 00:00:00 2001
|
|
From: Patrick Griffis <pgriffis@igalia.com>
|
|
Date: Sat, 16 Nov 2024 12:07:30 -0600
|
|
Subject: [PATCH] Fix heap buffer overflow in soup_content_sniffer_sniff
|
|
|
|
Co-Author: Ar Jun <pkillarjun@protonmail.com>
|
|
---
|
|
libsoup/soup-content-sniffer.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c
|
|
index 967ec614..26c65bbd 100644
|
|
--- a/libsoup/soup-content-sniffer.c
|
|
+++ b/libsoup/soup-content-sniffer.c
|
|
@@ -504,7 +504,7 @@ sniff_unknown (SoupContentSniffer *sniffer, SoupBuffer *buffer,
|
|
guint index_pattern = 0;
|
|
gboolean skip_row = FALSE;
|
|
|
|
- while ((index_stream < resource_length) &&
|
|
+ while ((index_stream < resource_length - 1) &&
|
|
(index_pattern <= type_row->pattern_length)) {
|
|
/* Skip insignificant white space ("WS" in the spec) */
|
|
if (type_row->pattern[index_pattern] == ' ') {
|
|
--
|
|
2.49.0
|
|
|