mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
subparse: don't deref a potentially NULL variable
If the html SAMI data is malformed, then retrieving the attribute name may fail. We then cannot retrieve the attribute value. Fixes: https://oss-fuzz.com/testcase-detail/4700130671984640 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2325>
This commit is contained in:
parent
d953d4de90
commit
105b0772c1
1 changed files with 4 additions and 0 deletions
|
@ -494,6 +494,10 @@ html_context_handle_element (HtmlContext * ctxt,
|
||||||
gchar *attr_name = NULL, *attr_value = NULL;
|
gchar *attr_name = NULL, *attr_value = NULL;
|
||||||
gsize length;
|
gsize length;
|
||||||
next = string_token (next + 1, "=", &attr_name);
|
next = string_token (next + 1, "=", &attr_name);
|
||||||
|
if (!next) {
|
||||||
|
g_free (attr_name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
next = string_token (next + 1, " ", &attr_value);
|
next = string_token (next + 1, " ", &attr_value);
|
||||||
|
|
||||||
/* strip " or ' from attribute value */
|
/* strip " or ' from attribute value */
|
||||||
|
|
Loading…
Reference in a new issue