Skip to content

Commit

Permalink
ezxml: cherry-pick the patch from netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre authored and davidcl committed Nov 3, 2022
1 parent 7bc6c56 commit f9fe7c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scilab/modules/scicos/src/c/ezxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ char *ezxml_decode(char *s, char **ent, char t)

if (e)
{
if(c > strlen(s) || strlen(e) > strlen(s + c)) {
fprintf(stderr, "Error: ezxml_decode(): memmove() past end of buffer!");
exit(-1);
}

memmove(s + c, e + 1, strlen(e)); // shift rest of string
strncpy(s, ent[b], c); // copy in replacement text
}
Expand Down

0 comments on commit f9fe7c9

Please sign in to comment.