zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: PATCH: possible null dereference with RC_QUOTES
Date: Sun, 12 Oct 2008 15:13:44 +0000	[thread overview]
Message-ID: <20081012151344.GA18912@scru.org> (raw)

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) {


                 reply	other threads:[~2008-10-12 15:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081012151344.GA18912@scru.org \
    --to=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).