From 14381f292c0ad3674b25039e0c879dafa789bbe7 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Fri, 22 Jun 2012 09:10:31 +0000
Subject: [PATCH] Fix bug from extracting the str_to_bits() code.

---
 src/sbbs3/js_console.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/sbbs3/js_console.cpp b/src/sbbs3/js_console.cpp
index 3610ff8fd5..134af7fede 100644
--- a/src/sbbs3/js_console.cpp
+++ b/src/sbbs3/js_console.cpp
@@ -273,6 +273,8 @@ static JSBool js_console_set(JSContext *cx, JSObject *obj, jsid id, JSBool stric
 			if(JSVAL_IS_STRING(*vp)) {
 				char *s;
 
+				if((str=JS_ValueToString(cx, *vp))==NULL)
+					break;
 				JSSTRING_TO_STRING(cx, str, s, NULL);
 				val=str_to_bits(sbbs->cfg.ctrlkey_passthru, s);
 			}
-- 
GitLab