Ecore_X(cb): Make sure we have argv[i] before we try to strlen it.
authordevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 22 Oct 2011 18:06:44 +0000 (18:06 +0000)
committerdevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 22 Oct 2011 18:06:44 +0000 (18:06 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@64302 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_x/xcb/ecore_xcb_icccm.c

index af0446e..425ebb1 100644 (file)
@@ -25,8 +25,8 @@ ecore_x_icccm_command_set(Ecore_X_Window win,
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
    CHECK_XCB_CONN;
 
-   for (i = 0, nbytes = 0; i < argc; i++)
-     nbytes += strlen(argv[i]) + 1;
+   for (i = 0, nbytes = 0; i < argc; i++) 
+     if (argv[i]) nbytes += strlen(argv[i]) + 1;
 
    buf = malloc(sizeof(char) * nbytes);
    if (!buf) return;