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

Fixed NULL dereference on blank "To" field and fixed "To All/blank" check for

private messages.
parent ed50655b
No related branches found
No related tags found
No related merge requests found
...@@ -204,17 +204,19 @@ bool sbbs_t::unpack_rep(char* repfile) ...@@ -204,17 +204,19 @@ bool sbbs_t::unpack_rep(char* repfile)
continue; continue;
} }
if(!stricmp(msg.to,"NETMAIL")) { /* QWK to FidoNet NetMail */ if(msg.to!=NULL) {
qwktonetmail(rep,block,NULL,0); if(stricmp(msg.to,"NETMAIL")==0) { /* QWK to FidoNet NetMail */
continue; qwktonetmail(rep,block,NULL,0);
} continue;
if(strchr(msg.to,'@')) { }
qwktonetmail(rep,block,msg.to,0); if(strchr(msg.to,'@')) {
continue; qwktonetmail(rep,block,msg.to,0);
} continue;
if(!stricmp(msg.to,"SBBS")) { /* to SBBS, config stuff */ }
qwkcfgline(msg.subj,INVALID_SUB); if(!stricmp(msg.to,"SBBS")) { /* to SBBS, config stuff */
continue; qwkcfgline(msg.subj,INVALID_SUB);
continue;
}
} }
if(useron.etoday>=cfg.level_emailperday[useron.level] if(useron.etoday>=cfg.level_emailperday[useron.level]
...@@ -222,11 +224,14 @@ bool sbbs_t::unpack_rep(char* repfile) ...@@ -222,11 +224,14 @@ bool sbbs_t::unpack_rep(char* repfile)
bputs(text[TooManyEmailsToday]); bputs(text[TooManyEmailsToday]);
continue; continue;
} }
usernum=atoi(msg.to); usernum=0;
if(usernum>lastuser(&cfg)) if(msg.to!=NULL) {
usernum=0; usernum=atoi(msg.to);
if(!usernum) if(usernum>lastuser(&cfg))
usernum=matchuser(&cfg,msg.to,TRUE /* sysop_alias */); usernum=0;
if(!usernum)
usernum=matchuser(&cfg,msg.to,TRUE /* sysop_alias */);
}
if(!usernum) { if(!usernum) {
bputs(text[UnknownUser]); bputs(text[UnknownUser]);
continue; continue;
...@@ -362,9 +367,11 @@ bool sbbs_t::unpack_rep(char* repfile) ...@@ -362,9 +367,11 @@ bool sbbs_t::unpack_rep(char* repfile)
if(useron.rest&FLAG('Q')) if(useron.rest&FLAG('Q'))
subscan[n].cfg|=SUB_CFG_NSCAN; subscan[n].cfg|=SUB_CFG_NSCAN;
if(!stricmp(msg.to,"SBBS")) { /* to SBBS, config stuff */ if(msg.to!=NULL) {
qwkcfgline(msg.subj,n); if(stricmp(msg.to,"SBBS")==0) { /* to SBBS, config stuff */
continue; qwkcfgline(msg.subj,n);
continue;
}
} }
#if 0 /* This stuff isn't really necessary anymore */ #if 0 /* This stuff isn't really necessary anymore */
...@@ -418,9 +425,9 @@ bool sbbs_t::unpack_rep(char* repfile) ...@@ -418,9 +425,9 @@ bool sbbs_t::unpack_rep(char* repfile)
if(block[0]=='*' || block[0]=='+' /* Private post */ if(block[0]=='*' || block[0]=='+' /* Private post */
|| cfg.sub[n]->misc&SUB_PONLY) { || cfg.sub[n]->misc&SUB_PONLY) {
if(msg.subj==NULL || !msg.subj[0] if(msg.to==NULL || !msg.to[0]
|| stricmp(msg.subj,"All")==0) { /* to blank */ || stricmp(msg.to,"All")==0) { /* to blank */
bputs(text[NoToUser]); /* or all */ bputs(text[NoToUser]); /* or all */
continue; continue;
} }
} }
......
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