Skip to content
Snippets Groups Projects
Commit 9e0dc7b5 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix potential NULL-ptr dereference caught by Coverity

Appear to have been possible (to crash) by using a malformed text.dat file.
parent 39c0b830
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -68,7 +68,8 @@ char *readtext(long *line,FILE *stream,long dflt)
continue;
break;
}
*(p)=0;
if(p != NULL)
*p = '\0';
k=strlen(buf);
for(i=1,j=0;i<k && j<sizeof(str)-1;j++) {
if(buf[i]=='\\') { /* escape */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment