mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
samiparse: Check that the string has a non-zero length before overwriting the last byte with '\0'
https://bugzilla.gnome.org/show_bug.cgi?id=777502
This commit is contained in:
parent
ef55c8a6b7
commit
d894c19db6
1 changed files with 2 additions and 1 deletions
|
@ -504,7 +504,8 @@ html_context_handle_element (HtmlContext * ctxt,
|
||||||
}
|
}
|
||||||
|
|
||||||
length = strlen (attr_value);
|
length = strlen (attr_value);
|
||||||
if (attr_value[length - 1] == '"' || attr_value[length - 1] == '\'') {
|
if (length > 0 && (attr_value[length - 1] == '"'
|
||||||
|
|| attr_value[length - 1] == '\'')) {
|
||||||
attr_value[length - 1] = '\0';
|
attr_value[length - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue