mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
svg_loader: fixed wrong boundary check
sz must be less than 20 to append 'carriage return'
This commit is contained in:
parent
59ffa16b32
commit
e737ee4a4f
1 changed files with 2 additions and 2 deletions
|
@ -2124,7 +2124,7 @@ static void _svgLoaderParserXmlOpen(SvgLoaderData* loader, const char* content,
|
|||
sz = attrs - content;
|
||||
attrsLength = length - sz;
|
||||
while ((sz > 0) && (isspace(content[sz - 1]))) sz--;
|
||||
if ((unsigned int)sz >= sizeof(tagName)) return;
|
||||
if ((uint)sz >= sizeof(tagName)) return;
|
||||
strncpy(tagName, content, sz);
|
||||
tagName[sz] = '\0';
|
||||
}
|
||||
|
@ -2486,7 +2486,7 @@ static bool _svgLoaderParserForValidCheckXmlOpen(SvgLoaderData* loader, const ch
|
|||
sz = attrs - content;
|
||||
attrsLength = length - sz;
|
||||
while ((sz > 0) && (isspace(content[sz - 1]))) sz--;
|
||||
if ((unsigned int)sz > sizeof(tagName)) return false;
|
||||
if ((uint)sz >= sizeof(tagName)) return false;
|
||||
strncpy(tagName, content, sz);
|
||||
tagName[sz] = '\0';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue