regcomp.c:126 fixed_size_dest: You might overrun the 100 byte fixed-size string buf by copying s without checking the length
regerror.c:11 fixed_size_dest: You might overrun the 132 byte fixed-size string buf by copying s without checking the length
regexec:174 leaked_storage: Variable relist0 going out of scope leaks the storage it points to
{
char buf[100];
strncpy(buf, "can't happen: ", sizeof(buf));
- strcat(buf, s);
+ strncat(buf, s, sizeof(buf)-1);
rcerror(buf);
}
char buf[132];
strncpy(buf, "regerror: ", sizeof(buf));
- strcat(buf, s);
- strcat(buf, "\n");
+ strncat(buf, s, sizeof(buf)-1);
+ strncat(buf, "\n", sizeof(buf)-1);
write(2, buf, strlen(buf));
exit(1);
}
return -1;
relist1 = malloc(BIGLISTSIZE*sizeof(Relist));
if(relist1 == NULL){
- free(relist1);
+ free(relist0);
return -1;
}
j->relist[0] = relist0;