mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 17:20:25 +02:00
25611, 25613: protect against two possible NULL dereferences.
This commit is contained in:
parent
29680850a0
commit
13f60efbd7
2 changed files with 25 additions and 18 deletions
|
|
@ -1,5 +1,8 @@
|
|||
2008-09-04 Clint Adams <clint@zsh.org>
|
||||
|
||||
* 25611, 25613: Src/Modules/curses.c: protect against two possible
|
||||
NULL dereferences.
|
||||
|
||||
* 25612: Src/Zle/compmatch.c: remove dead code.
|
||||
|
||||
* 25610: Src/hist.c: remove dead code.
|
||||
|
|
|
|||
|
|
@ -874,7 +874,7 @@ zccmd_attr(const char *nam, char **args)
|
|||
if ((zca = zcurses_attrget(w->win, ptr)) == NULL) {
|
||||
zwarnnam(nam, "attribute `%s' not known", ptr);
|
||||
ret = 1;
|
||||
}
|
||||
} else {
|
||||
switch(onoff) {
|
||||
case ZCURSES_ATTRON:
|
||||
if (wattron(w->win, zca->number) == ERR)
|
||||
|
|
@ -887,6 +887,7 @@ zccmd_attr(const char *nam, char **args)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -948,17 +949,20 @@ zccmd_bg(const char *nam, char **args)
|
|||
if ((zca = zcurses_attrget(w->win, ptr)) == NULL) {
|
||||
zwarnnam(nam, "attribute `%s' not known", ptr);
|
||||
ret = 1;
|
||||
}
|
||||
} else {
|
||||
switch(onoff) {
|
||||
case ZCURSES_ATTRON:
|
||||
ch |= zca->number;
|
||||
if (wattron(w->win, zca->number) == ERR)
|
||||
ret = 1;
|
||||
break;
|
||||
case ZCURSES_ATTROFF:
|
||||
ch &= ~zca->number;
|
||||
if (wattroff(w->win, zca->number) == ERR)
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
return wbkgd(w->win, ch) != OK;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue