edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Christopher Brannon <chris@the-brannons.com>
To: edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] [PATCH] Add a missing NULL check.
Date: Mon, 27 Jan 2014 17:49:10 -0800	[thread overview]
Message-ID: <1390873750-22636-1-git-send-email-chris@the-brannons.com> (raw)

In the changes for mozjs-24, I forgot a NULL check.
isJSAlive should return false if cw->jss is unallocated, rather
than dereferencing NULL!
---
 src/jsdom.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/jsdom.cpp b/src/jsdom.cpp
index a37eaec..5a60895 100644
--- a/src/jsdom.cpp
+++ b/src/jsdom.cpp
@@ -61,7 +61,7 @@ my_ErrorReporter(JSContext * cx, const char *message, JSErrorReport * report)
 eb_bool
 isJSAlive(void)
 {
-    return cw->jss->jcx != NULL;
+    return (cw->jss != NULL) && (cw->jss->jcx != NULL);
 }				/* isJSAlive */
 
 JSString *
-- 
1.8.3.2


             reply	other threads:[~2014-01-28  1:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28  1:49 Christopher Brannon [this message]
2014-01-28  9:06 ` Adam Thompson

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=1390873750-22636-1-git-send-email-chris@the-brannons.com \
    --to=chris@the-brannons.com \
    --cc=edbrowse-dev@lists.the-brannons.com \
    /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.
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).