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

Added bounds-check in qwk_route().

Fix multi-choice poll import (from QWKnet) bug: MaxVotes was used for polls in
(not "votes) in VOTING.DAT file. Oops.
parent c929067b
No related branches found
No related tags found
No related merge requests found
......@@ -139,6 +139,9 @@ extern "C" int DLLCALL qwk_route(scfg_t* cfg, const char *inaddr, char *fulladdr
p=strchr(node,' ');
if(p) *p=0;
if(strlen(node) > LEN_QWKID)
return 0;
SAFEPRINTF(path,"%sqnet/route.dat",cfg->data_dir);
if((stream=fnopen(&file,path,O_RDONLY))==NULL)
return(0);
......@@ -1142,8 +1145,8 @@ bool sbbs_t::qwk_vote(str_list_t ini, const char* section, smb_net_type_t net_ty
if(strnicmp(section, "poll:", 5) == 0) {
smb_hfield_str(&msg, RFC822MSGID, section + 5);
msg.hdr.votes = iniGetShortInt(ini, section, "votes", 0);
ulong results = iniGetLongInt(ini, section, "results", 0);
msg.hdr.votes = iniGetShortInt(ini, section, "MaxVotes", 0);
ulong results = iniGetLongInt(ini, section, "Results", 0);
msg.hdr.auxattr = (results << POLL_RESULTS_SHIFT) & POLL_RESULTS_MASK;
for(int i=0;;i++) {
char str[128];
......
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