From 95daad571df9761cefb619d5f4265d3cf3ae0db7 Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Sat, 11 Jan 2014 21:01:49 +0200 Subject: [PATCH] Fix for potential buffer override in nsvg__parseElement() --- src/nanosvg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nanosvg.h b/src/nanosvg.h index 098e5b2..e204bb7 100644 --- a/src/nanosvg.h +++ b/src/nanosvg.h @@ -177,7 +177,7 @@ static void nsvg__parseElement(char* s, if (*s) { *s++ = '\0'; } // Get attribs - while (!end && *s && nattr < NSVG_XML_MAX_ATTRIBS-1) { + while (!end && *s && nattr < NSVG_XML_MAX_ATTRIBS-3) { // Skip white space before the attrib name while (*s && nsvg__isspace(*s)) s++; if (!*s) break;