Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 7b50f26d authored by rswindell's avatar rswindell

Address coverity-scan reported issues.

parent 15ffe90a
......@@ -158,7 +158,9 @@ const char* sbbs_t::atcode(char* sp, char* str, size_t maxlen)
return(COPYRIGHT_NOTICE);
if(!strcmp(sp,"COMPILER")) {
DESCRIBE_COMPILER(str);
char compiler[32];
DESCRIBE_COMPILER(compiler);
strncpy(str, compiler, maxlen);
return(str);
}
......
......@@ -582,8 +582,8 @@ bool sbbs_t::guru_page(void)
return(false);
}
if((gurubuf=(char *)malloc((size_t)filelength(file)+1))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,path,(size_t)filelength(file)+1);
close(file);
return(false);
}
read(file,gurubuf,(size_t)filelength(file));
......
......@@ -356,7 +356,6 @@ int main(int argc, char **argv)
p=getenv("SBBSNODE");
if(!p) {
goto USAGE;
exit(1);
}
SAFECOPY(str,p);
backslash(str);
......
......@@ -164,7 +164,6 @@ BOOL DLLCALL addfiledat(scfg_t* cfg, file_t* f)
uchar *ixbbuf,idx[3];
int i,file;
long l,length;
time_t now;
time_t uldate;
/************************/
......@@ -224,9 +223,9 @@ BOOL DLLCALL addfiledat(scfg_t* cfg, file_t* f)
/*******************************************/
SAFEPRINTF2(str,"%s%s.dab",cfg->dir[f->dir]->data_dir,cfg->dir[f->dir]->code);
if((file=sopen(str,O_WRONLY|O_CREAT|O_BINARY,SH_DENYRW,DEFFILEMODE))!=-1) {
now=time(NULL);
/* TODO: 32-bit *or* LE required */
write(file,&now,4);
time32_t now=time32(NULL);
/* TODO: LE required */
write(file,&now,sizeof(time32_t));
close(file);
}
......
......@@ -43,6 +43,7 @@
offset+=sizeof(var); }
#define get_str(var,stream) { if(!fread(var,1,sizeof(var),stream)) \
memset(var,0,sizeof(var)); \
else var[sizeof(var)-1] = 0; \
offset+=sizeof(var); }
#ifdef __cplusplus
......
......@@ -267,6 +267,7 @@ BOOL read_file_cfg(scfg_t* cfg, char* error)
for(i=0;i<cfg->altpaths;i++) {
if(feof(instream)) break;
fread(str,LEN_DIR+1,1,instream);
str[LEN_DIR] = 0;
offset+=LEN_DIR+1;
backslash(str);
j=LEN_DIR+1;
......
......@@ -1584,7 +1584,6 @@ static service_t* read_services_ini(const char* services_ini, service_t* service
}
if((np=(service_t*)realloc(service,sizeof(service_t)*((*services)+1)))==NULL) {
fclose(fp);
lprintf(LOG_CRIT,"!MALLOC FAILURE");
free(default_interfaces);
iniFreeStringList(sec_list);
......
......@@ -989,9 +989,10 @@ void sbbs_t::xtrndat(const char *name, const char *dropdir, uchar type, ulong tl
i=cfg.level_timepercall[useron.level]; /* Time allowed on */
write(file,&i,2);
c=0;
i=0; /* Allowed K-bytes for D/L */
write(file,&i,2);
write(file,&i,1); /* Conference user was in */
write(file,&c,1); /* Conference user was in */
write(file,&i,2); /* Conferences joined */
write(file,&i,2); /* "" */
write(file,&i,2); /* "" */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment