Skip to content
Snippets Groups Projects
Commit 437f8712 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Range check value when using default text.

parent 976e8a0f
No related branches found
No related tags found
No related merge requests found
Pipeline #7763 passed
...@@ -140,9 +140,12 @@ char *readtext(int *line,FILE *stream,int dflt) ...@@ -140,9 +140,12 @@ char *readtext(int *line,FILE *stream,int dflt)
strcpy(p,str); strcpy(p,str);
return(p); return(p);
use_default: use_default:
p=strdup(text_defaults[dflt]); if (dflt < TOTAL_TEXT) {
if(p==NULL) p=strdup(text_defaults[dflt]);
lprintf(LOG_CRIT,"Error duplicating %s text defaults",text_defaults[dflt]); if(p==NULL)
return(p); lprintf(LOG_CRIT,"Error duplicating %s text defaults",text_defaults[dflt]);
return(p);
}
lprintf(LOG_CRIT,"Text defaults missing %d",dflt);
return NULL;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment