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
@ -504,7 +504,8 @@ html_context_handle_element (HtmlContext * ctxt,
|
||||
}
|
||||
|
||||
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';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user