Skip to content

Commit 7ad0074

Browse files
sylvestredavidcl
authored andcommitted
ezxml: cherry-pick the patch from netcdf
Unidata/netcdf-c#2125 Fix CVE-2022-30045 Reported: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1014391 Credits to Dennis Heimbigner
1 parent 7bc6c56 commit 7ad0074

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scilab/modules/scicos/src/c/ezxml.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ char *ezxml_decode(char *s, char **ent, char t)
303303

304304
if (e)
305305
{
306+
if(c > strlen(s) || strlen(e) > strlen(s + c)) {
307+
fprintf(stderr, "Error: ezxml_decode(): memmove() past end of buffer!");
308+
exit(-1);
309+
}
310+
306311
memmove(s + c, e + 1, strlen(e)); // shift rest of string
307312
strncpy(s, ent[b], c); // copy in replacement text
308313
}

0 commit comments

Comments
 (0)