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

Fix CID 174508

And other safety improvements in getsub()
parent 2adf1459
Branches
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4905 failed
...@@ -123,7 +123,7 @@ uint getsub(void) ...@@ -123,7 +123,7 @@ uint getsub(void)
static int sub_dflt,sub_bar; static int sub_dflt,sub_bar;
char str[81]; char str[81];
int i,j,k; int i,j,k;
uint subnum[MAX_OPTS+1]; uint subnum[MAX_OPTS+1] = {0};
while(1) { while(1) {
i = getgrp("Select Message Group"); i = getgrp("Select Message Group");
...@@ -135,9 +135,9 @@ uint getsub(void) ...@@ -135,9 +135,9 @@ uint getsub(void)
subnum[k++]=j; subnum[k++]=j;
} }
opt[k][0]=0; 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); 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; continue;
sub_dflt++; sub_dflt++;
sub_bar++; sub_bar++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment