Skip to content
Snippets Groups Projects
Commit a738b950 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix CID 174508

And other safety improvements in getsub()
parent e65d6faa
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -123,7 +123,7 @@ uint getsub(void)
static int sub_dflt,sub_bar;
char str[81];
int i,j,k;
uint subnum[MAX_OPTS+1];
uint subnum[MAX_OPTS+1] = {0};
while(1) {
i = getgrp("Select Message Group");
......@@ -135,9 +135,9 @@ uint getsub(void)
subnum[k++]=j;
}
opt[k][0]=0;
sprintf(str,"Select %s Sub-board",cfg.grp[i]->sname);
snprintf(str, sizeof str, "Select %s Sub-board", cfg.grp[i]->sname);
j=uifc.list(WIN_RHT|WIN_BOT|WIN_SAV,0,0,45,&sub_dflt,&sub_bar,str,opt);
if(j==-1 || j >= cfg.total_subs)
if(j < 0 || j >= cfg.total_subs || j >= MAX_OPTS)
continue;
sub_dflt++;
sub_bar++;
......
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