Skip to content

Commit

Permalink
Initialize all the SVG style fields
Browse files Browse the repository at this point in the history
Missing initialization could lead to freeing invalid point in
nsvg__deleteStyles. You can trigger it with following b64'd
SVG file:

PHN0eWxlPnN0eWxlPjxzdmc+PD5zdmf/////Cv//eWwwRT48c3Znc3Y=
  • Loading branch information
janisozaur committed May 19, 2019
1 parent aacd0f6 commit a1f2a0d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nanosvg.h
Expand Up @@ -2788,6 +2788,7 @@ static void nsvg__content(void* ud, const char* s)
p->styles = (NSVGstyles*)malloc(sizeof(NSVGstyles));
p->styles->next = next;
p->styles->name = nsvg__strndup(start, (size_t)(s - start));
p->styles->next = NULL;
start = s + 1;
state = 2;
}
Expand Down

0 comments on commit a1f2a0d

Please sign in to comment.