[seed] Fix segfault introduced in the argv changes with NULL argv
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Fix segfault introduced in the argv changes with NULL argv
- Date: Fri, 8 May 2009 23:54:08 -0400 (EDT)
commit 8ef42078909b9b4e5f8b915992f597f9910eea3b
Author: Robert Carr <racarr svn gnome org>
Date: Fri May 8 23:53:56 2009 -0400
Fix segfault introduced in the argv changes with NULL argv
---
libseed/seed-builtins.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libseed/seed-builtins.c b/libseed/seed-builtins.c
index 4368570..4f23d2d 100644
--- a/libseed/seed-builtins.c
+++ b/libseed/seed-builtins.c
@@ -438,6 +438,8 @@ seed_argv_get_property (JSContextRef ctx,
gint index;
priv = JSObjectGetPrivate (object);
+ if (!priv->argc)
+ return JSValueMakeUndefined (ctx);
length = JSStringGetMaximumUTF8CStringSize (property_name);
cproperty_name = g_alloca (length * sizeof (gchar));
JSStringGetUTF8CString (property_name, cproperty_name, length);
@@ -497,8 +499,8 @@ seed_init_builtins (SeedEngine * local_eng, gint * argc, gchar *** argv)
&seed_breakpoint, obj);
priv = g_new0 (SeedArgvPrivates, 1);
- priv->argv = *argv;
- priv->argc = *argc;
+ priv->argv = argv ? *argv : 0;
+ priv->argc = argc ? *argc : 0;
seed_argv_class = JSClassCreate (&seed_argv_def);
arrayObj = JSObjectMake (local_eng->context, seed_argv_class, priv);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]