Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: curses null dereference risk part 2
- X-seq: zsh-workers 25613
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: curses null dereference risk part 2
- Date: Thu, 4 Sep 2008 20:32:01 +0000
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Another one. By the way, these are being identified by
http://scan.coverity.com/ . I think any member of the Zsh Development
Group can get an account there at the cost of some proprietary EULA.
Also the sunsite.dk mail server seems a bit broken right now.
Index: Src/Modules/curses.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/curses.c,v
retrieving revision 1.45
diff -u -r1.45 curses.c
--- Src/Modules/curses.c 13 Mar 2008 11:11:04 -0000 1.45
+++ Src/Modules/curses.c 4 Sep 2008 20:24:24 -0000
@@ -874,16 +874,17 @@
if ((zca = zcurses_attrget(w->win, ptr)) == NULL) {
zwarnnam(nam, "attribute `%s' not known", ptr);
ret = 1;
- }
- switch(onoff) {
- case ZCURSES_ATTRON:
- if (wattron(w->win, zca->number) == ERR)
- ret = 1;
- break;
- case ZCURSES_ATTROFF:
- if (wattroff(w->win, zca->number) == ERR)
- ret = 1;
- break;
+ } else {
+ switch(onoff) {
+ case ZCURSES_ATTRON:
+ if (wattron(w->win, zca->number) == ERR)
+ ret = 1;
+ break;
+ case ZCURSES_ATTROFF:
+ if (wattroff(w->win, zca->number) == ERR)
+ ret = 1;
+ break;
+ }
}
}
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author