forked from enlightenment/efl
evas_vg_load_svg: Fix negative attrs length
Summary: After finding no attributes but spaces, attrsLength could be negative. This will cause a segfault in parser functions. So, change the position of attrs_length to prevent this. Test Plan: Example SVG ``` <?xml version="1.0" encoding="UTF-8"?> <svg><g ></g></svg> ``` Reviewers: Hermet, raster, kimcinoo Reviewed By: Hermet Subscribers: #reviewers, cedric, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12314
This commit is contained in:
parent
c3a5aa2f2c
commit
76f698faf0
|
@ -2276,12 +2276,12 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader,
|
|||
{
|
||||
// find out the tag name starting from content till sz length
|
||||
sz = attrs - content;
|
||||
attrs_length = length - sz;
|
||||
while ((sz > 0) && (isspace(content[sz - 1])))
|
||||
sz--;
|
||||
if ((unsigned int)sz >= sizeof(tag_name)) return;
|
||||
strncpy(tag_name, content, sz);
|
||||
tag_name[sz] = '\0';
|
||||
attrs_length = length - sz;
|
||||
}
|
||||
|
||||
if ((method = _find_group_factory(tag_name)))
|
||||
|
|
Loading…
Reference in New Issue