Check buffer length in parseCoordinateRaw

This commit is contained in:
djack1010 2017-04-22 23:41:19 +02:00
parent b20e2eb968
commit 4310325aba

View File

@ -1388,7 +1388,7 @@ static NSVGcoordinate nsvg__parseCoordinateRaw(const char* str)
{
NSVGcoordinate coord = {0, NSVG_UNITS_USER};
char units[32]="";
sscanf(str, "%f%s", &coord.value, units);
sscanf(str, "%f%31s", &coord.value, units);
coord.units = nsvg__parseUnits(units);
return coord;
}
@ -2799,7 +2799,7 @@ NSVGimage* nsvgParse(char* input, const char* units, float dpi)
p->dpi = dpi;
nsvg__parseXML(input, nsvg__startElement, nsvg__endElement, nsvg__content, p);
// Scale to viewBox
nsvg__scaleToViewbox(p, units);