zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: curses null dereference risk part 2
@ 2008-09-04 20:32 Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2008-09-04 20:32 UTC (permalink / raw)
  To: zsh-workers

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;
+		}
 	    }
 	}
     }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-05  0:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-04 20:32 PATCH: curses null dereference risk part 2 Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).