mpegts: network_name: Check converted length

Check the length of the name argument after it has been converted.

https://bugzilla.gnome.org/show_bug.cgi?id=723953
This commit is contained in:
Jesper Larsen 2014-02-22 18:22:26 +01:00 committed by Edward Hervey
parent bb22c6e7c4
commit e28b6fd523

View file

@ -92,10 +92,11 @@ gst_mpegts_descriptor_from_dvb_network_name (const gchar * name)
gsize size;
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (strlen (name) <= 256, NULL);
converted_name = dvb_text_from_utf8 (name, &size);
g_return_val_if_fail (size < 256, NULL);
if (!converted_name) {
GST_WARNING ("Could not find proper encoding for string `%s`", name);
return NULL;