Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: possible null dereference with RC_QUOTES



If tokstr can be NULL, then we don't want to try the *tt1 below.

Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.96
diff -u -r1.96 zle_tricky.c
--- Src/Zle/zle_tricky.c	8 Sep 2008 22:18:03 -0000	1.96
+++ Src/Zle/zle_tricky.c	12 Oct 2008 15:12:25 -0000
@@ -1235,7 +1235,7 @@
 	    /* This is done when the lexer reached the word the cursor is on. */
 	    tt = tokstr ? dupstring(tokstr) : NULL;
 
-            if (isset(RCQUOTES)) {
+            if (isset(RCQUOTES) && tt) {
 		char *tt1, *e = tt + zlemetacs - wb;
 		for (tt1 = tt; *tt1; tt1++) {
 		    if (*tt1 == Snull) {



Messages sorted by: Reverse Date, Date, Thread, Author