[PATCH] Defensively protect against bogus argv argument on W32CE.

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Thu Apr 29 16:44:28 PDT 2010


---
 dbus/dbus-spawn-win.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dbus/dbus-spawn-win.c b/dbus/dbus-spawn-win.c
index b2cc4e6..8ac837e 100644
--- a/dbus/dbus-spawn-win.c
+++ b/dbus/dbus-spawn-win.c
@@ -522,7 +522,10 @@ spawn_program (char* name, char** argv, char** envp)
   BOOL result;
 
 #ifdef DBUS_WINCE
-  arg_string = build_commandline (argv + 1);
+  if (argv && argv[0])
+    arg_string = build_commandline (argv + 1);
+  else
+    arg_string = NULL;
 #else
   arg_string = build_commandline (argv);
 #endif
-- 
1.7.0.4


--------------050304000405070402030901--


More information about the dbus mailing list