From: Sebastian Dröge Date: Wed, 9 Oct 2024 15:23:47 +0000 (-0400) Subject: subparse: Check for NULL return of strchr() when parsing LRC subtitles X-Git-Tag: 1.24.10~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a5fdba14a1ccfe473bc4429f22ee5bbaee034eb;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/subprojects/gst-plugins-base/gst/subparse/gstsubparse.c b/subprojects/gst-plugins-base/gst/subparse/gstsubparse.c index 994cf62d1a..4fe43d9100 100644 --- a/subprojects/gst-plugins-base/gst/subparse/gstsubparse.c +++ b/subprojects/gst-plugins-base/gst/subparse/gstsubparse.c @@ -1066,6 +1066,11 @@ parse_lrc (ParserState * state, const gchar * line) 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