Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: negative array indexing in disableshfuncnode
- X-seq: zsh-workers 25985
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: negative array indexing in disableshfuncnode
- Date: Sat, 1 Nov 2008 01:14:58 +0000
- Mail-followup-to: zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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);
+ }
}
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author