File: CVE-2025-32909.patch

package info (click to toggle)
libsoup2.4 2.74.3-10.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 7,236 kB
  • sloc: ansic: 57,709; xml: 1,392; python: 84; php: 75; javascript: 64; sh: 49; makefile: 28
file content (29 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Patrick Griffis <pgriffis@igalia.com>
Date: Wed, 8 Jan 2025 16:30:17 -0600
Subject: content-sniffer: Handle sniffing resource shorter than 4 bytes

(cherry picked from commit ba4c3a6f988beff59e45801ab36067293d24ce92)
---
 libsoup/soup-content-sniffer.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libsoup/soup-content-sniffer.c b/libsoup/soup-content-sniffer.c
index 3fb29ad..4e3a5b3 100644
--- a/libsoup/soup-content-sniffer.c
+++ b/libsoup/soup-content-sniffer.c
@@ -227,9 +227,14 @@ sniff_mp4 (SoupContentSniffer *sniffer, SoupBuffer *buffer)
 {
 	const char *resource = (const char *)buffer->data;
 	guint resource_length = MIN (512, buffer->length);
-	guint32 box_size = *((guint32*)resource);
+	guint32 box_size;
 	guint i;
 
+        if (resource_length < sizeof (guint32))
+                return FALSE;
+
+	box_size = *((guint32*)resource);
+
 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
 	box_size = ((box_size >> 24) |
 		    ((box_size << 8) & 0x00FF0000) |