From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (unknown [IPv6:2602:4b:a4d8:4b00:12bf:48ff:fe7c:5584]) by hurricane.the-brannons.com (Postfix) with ESMTPSA id B925777894 for ; Mon, 27 Jan 2014 17:49:30 -0800 (PST) From: Christopher Brannon To: edbrowse-dev@lists.the-brannons.com Date: Mon, 27 Jan 2014 17:49:10 -0800 Message-Id: <1390873750-22636-1-git-send-email-chris@the-brannons.com> X-Mailer: git-send-email 1.8.3.2 Subject: [Edbrowse-dev] [PATCH] Add a missing NULL check. X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2014 01:49:31 -0000 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