Skip to content
Snippets Groups Projects
Commit e5d9cbc5 authored by rswindell's avatar rswindell
Browse files

Log an error when attempting to execute a 0-byte .bin file.

parent f96a00ef
No related branches found
No related tags found
No related merge requests found
......@@ -790,7 +790,12 @@ long sbbs_t::exec_bin(const char *cmdline, csi_t *csi, const char* startup_dir)
memcpy(&bin,csi,sizeof(csi_t));
clearvars(&bin);
bin.length=(uint32_t)filelength(file);
bin.length = filelength(file);
if(bin.length < 1) {
close(file);
errormsg(WHERE, ERR_LEN, str, bin.length);
return -1;
}
if((bin.cs=(uchar *)malloc(bin.length))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,bin.length);
......
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