Commit 8ba13146 authored by rswindell's avatar rswindell
Browse files

A couple of bug-fixes (NULL pointer dereferences) when the option list is NULL

terminated.
parent 952ee69b
......@@ -556,9 +556,11 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if(!width || width<title_len+hbrdrsize+2) {
width=title_len+hbrdrsize+2;
for(i=0;i<opts;i++) {
truncsp(option[i]);
if((j=strlen(option[i])+hbrdrsize+2+1)>width)
width=j;
if(option[i]!=NULL) {
truncsp(option[i]);
if((j=strlen(option[i])+hbrdrsize+2+1)>width)
width=j;
}
}
}
/* Determine minimum widths here to accomodate mouse "icons" in border */
......@@ -776,7 +778,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
a=api->lbclr;
else
a=api->lclr|(api->bclr<<4);
if(i<opts) {
if(i<opts && option[i]!=NULL) {
b=strlen(option[i]);
if(b>longopt)
longopt=b;
......
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