* PATCH: negative array indexing in disableshfuncnode
@ 2008-11-01 1:14 Clint Adams
0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2008-11-01 1:14 UTC (permalink / raw)
To: zsh-workers
Coverity CID 46:
If you declare TRAPNOTHING(), then disable -f TRAPNOTHING,
this would try to set sigtrapped[-1].
Index: Src/hashtable.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/hashtable.c,v
retrieving revision 1.29
diff -u -r1.29 hashtable.c
--- Src/hashtable.c 11 Sep 2008 17:14:39 -0000 1.29
+++ Src/hashtable.c 1 Nov 2008 01:11:58 -0000
@@ -819,8 +819,10 @@
hn->flags |= DISABLED;
if (!strncmp(hn->nam, "TRAP", 4)) {
int signum = getsignum(hn->nam + 4);
- sigtrapped[signum] &= ~ZSIG_FUNC;
- unsettrap(signum);
+ if (signum != -1) {
+ sigtrapped[signum] &= ~ZSIG_FUNC;
+ unsettrap(signum);
+ }
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-11-01 1:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-01 1:14 PATCH: negative array indexing in disableshfuncnode 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).