[gjs] GType: ensure that function and properties definitions are closed
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] GType: ensure that function and properties definitions are closed
- Date: Mon, 6 Feb 2012 19:15:14 +0000 (UTC)
commit b5ba02d8625ca12cfc4ed1f95f96ace4a331a8a1
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Mon Feb 6 16:28:22 2012 +0100
GType: ensure that function and properties definitions are closed
The JSAPI expects to find a NULL name at the end of property and
function definitions in JS_InitClass, and not finding it it will
handle bogus memory to string.h functions (which is a secure crash)
https://bugzilla.gnome.org/show_bug.cgi?id=669458
gi/gtype.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gi/gtype.c b/gi/gtype.c
index 501903a..d47e16f 100644
--- a/gi/gtype.c
+++ b/gi/gtype.c
@@ -105,12 +105,14 @@ get_name_func (JSContext *context,
/* Properties */
static JSPropertySpec gjs_gtype_proto_props[] = {
- { "name", 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED, (JSPropertyOp)get_name_func, NULL }
+ { "name", 0, JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED, (JSPropertyOp)get_name_func, NULL },
+ { NULL },
};
/* Functions */
static JSFunctionSpec gjs_gtype_proto_funcs[] = {
- { "toString", (JSNative)to_string_func, 0, 0 }
+ { "toString", (JSNative)to_string_func, 0, 0 },
+ { NULL },
};
JSObject *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]