[gjs] context: Make sure to quit early when logError() is given incorrect args
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] context: Make sure to quit early when logError() is given incorrect args
- Date: Tue, 25 Jun 2013 19:40:20 +0000 (UTC)
commit ef2b134136fc3c093dae06d0a79621bb12b953b8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Jun 24 21:05:52 2013 -0400
context: Make sure to quit early when logError() is given incorrect args
https://bugzilla.gnome.org/show_bug.cgi?id=703068
gjs/context.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gjs/context.c b/gjs/context.c
index 4419ed9..bcd51ae 100644
--- a/gjs/context.c
+++ b/gjs/context.c
@@ -160,13 +160,14 @@ gjs_log_error(JSContext *context,
JSExceptionState *exc_state;
JSString *jstr;
- JS_BeginRequest(context);
-
if ((argc != 1 && argc != 2) ||
!JSVAL_IS_OBJECT (argv[0])) {
gjs_throw(context, "Must pass an exception and optionally a message to logError()");
+ return JS_FALSE;
}
+ JS_BeginRequest(context);
+
if (argc == 2) {
/* JS_ValueToString might throw, in which we will only
*log that the value could be converted to string */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]