edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] [PATCH] Add a missing NULL check.
@ 2014-01-28  1:49 Christopher Brannon
  2014-01-28  9:06 ` Adam Thompson
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Brannon @ 2014-01-28  1:49 UTC (permalink / raw)
  To: edbrowse-dev

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-28  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-28  1:49 [Edbrowse-dev] [PATCH] Add a missing NULL check Christopher Brannon
2014-01-28  9:06 ` Adam Thompson

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