File CVE-2024-47835.patch of Package gstreamer-plugins-base.36924
From 4c40f73b7002967e824ef34a5435282f4a0ea363 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Wed, 9 Oct 2024 11:23:47 -0400
Subject: [PATCH] subparse: Check for NULL return of strchr() when parsing LRC
subtitles
Thanks to Antonio Morales for finding and reporting the issue.
Fixes GHSL-2024-263
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3892
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8039>
---
diff -urp gst-plugins-base-1.24.7.orig/gst/subparse/gstsubparse.c gst-plugins-base-1.24.7/gst/subparse/gstsubparse.c
--- gst-plugins-base-1.24.7.orig/gst/subparse/gstsubparse.c 2024-08-21 07:25:15.000000000 -0400
+++ gst-plugins-base-1.24.7/gst/subparse/gstsubparse.c 2024-12-16 03:11:46.924564800 -0500
@@ -1066,6 +1066,11 @@ parse_lrc (ParserState * state, const gc
return NULL;
start = strchr (line, ']');
+ // sscanf() does not check for the trailing ] but only up to the last
+ // placeholder, so there might be no ] at the end.
+ if (!start)
+ return NULL;
+
if (start - line == 9)
milli = 10;
else