Check buffer length in parseCoordinateRaw
This commit is contained in:
parent
b20e2eb968
commit
4310325aba
@ -1388,7 +1388,7 @@ static NSVGcoordinate nsvg__parseCoordinateRaw(const char* str)
|
|||||||
{
|
{
|
||||||
NSVGcoordinate coord = {0, NSVG_UNITS_USER};
|
NSVGcoordinate coord = {0, NSVG_UNITS_USER};
|
||||||
char units[32]="";
|
char units[32]="";
|
||||||
sscanf(str, "%f%s", &coord.value, units);
|
sscanf(str, "%f%31s", &coord.value, units);
|
||||||
coord.units = nsvg__parseUnits(units);
|
coord.units = nsvg__parseUnits(units);
|
||||||
return coord;
|
return coord;
|
||||||
}
|
}
|
||||||
@ -2799,7 +2799,7 @@ NSVGimage* nsvgParse(char* input, const char* units, float dpi)
|
|||||||
p->dpi = dpi;
|
p->dpi = dpi;
|
||||||
|
|
||||||
nsvg__parseXML(input, nsvg__startElement, nsvg__endElement, nsvg__content, p);
|
nsvg__parseXML(input, nsvg__startElement, nsvg__endElement, nsvg__content, p);
|
||||||
|
|
||||||
// Scale to viewBox
|
// Scale to viewBox
|
||||||
nsvg__scaleToViewbox(p, units);
|
nsvg__scaleToViewbox(p, units);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user