Commits (1)
...@@ -1457,7 +1457,7 @@ char* readsmsg(scfg_t* cfg, int usernumber) ...@@ -1457,7 +1457,7 @@ char* readsmsg(scfg_t* cfg, int usernumber)
if((file=nopen(str,O_RDWR))==-1) if((file=nopen(str,O_RDWR))==-1)
return(NULL); return(NULL);
length=(long)filelength(file); length=(long)filelength(file);
if((buf=(char *)malloc(length+1))==NULL) { if(length < 0 || (buf=(char *)malloc(length+1))==NULL) {
close(file); close(file);
return(NULL); return(NULL);
} }
......