gst/subparse/gstsubparse.c: Fix invalid memory access: make sure string passed to regexec() is NUL-termianted.

Original commit message from CVS:
* gst/subparse/gstsubparse.c: (gst_subparse_type_find):
Fix invalid memory access: make sure string passed to
regexec() is NUL-termianted.
This commit is contained in:
Tim-Philipp Müller 2006-03-09 12:56:35 +00:00
parent 2bd6096768
commit b57078cd60
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2006-03-09 Tim-Philipp Müller <tim at centricular dot net>
* gst/subparse/gstsubparse.c: (gst_subparse_type_find):
Fix invalid memory access: make sure string passed to
regexec() is NUL-termianted.
2006-03-09 Tim-Philipp Müller <tim at centricular dot net>
* gst/typefind/gsttypefindfunctions.c: (mp3_type_find_at_offset),

View file

@ -867,10 +867,16 @@ gst_subparse_type_find (GstTypeFind * tf, gpointer private)
{
const guint8 *data;
GstSubParseFormat format;
gchar *str;
if (!(data = gst_type_find_peek (tf, 0, 36)))
return;
format = gst_sub_parse_data_format_autodetect ((gchar *) data);
/* make sure string passed to _autodetect() is NUL-terminated */
str = g_strndup ((gchar *) data, 35);
format = gst_sub_parse_data_format_autodetect (str);
g_free (str);
switch (format) {
case GST_SUB_PARSE_FORMAT_MDVDSUB:
GST_DEBUG ("MicroDVD format detected");