From 4310325aba2a1062ffe6f3b54cc752a629f735ea Mon Sep 17 00:00:00 2001 From: djack1010 Date: Sat, 22 Apr 2017 23:41:19 +0200 Subject: [PATCH] Check buffer length in parseCoordinateRaw --- src/nanosvg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nanosvg.h b/src/nanosvg.h index 6493aa6..1ad8a9a 100644 --- a/src/nanosvg.h +++ b/src/nanosvg.h @@ -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);