fix possible 0 byte allocation
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 16 Dec 2011 18:04:53 +0000 (18:04 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 16 Dec 2011 18:04:53 +0000 (18:04 +0000)
SVN revision: 66294

legacy/ecore/ChangeLog
legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c

index 36af3ff..14a8850 100644 (file)
         plug process to it can see key, mouse, multi etc. events.
 
 
+2011-12-16 Mike Blumenkrantz
+
+        * Fix possible 0 byte allocation in ecore-x
index 7168d49..6d275bc 100644 (file)
@@ -1132,7 +1132,7 @@ ecore_x_window_root_list(int *num_ret)
                          overlap++;
                     }
                }
-             roots = malloc((num - overlap) * sizeof(Window));
+             roots = malloc(MAX((num - overlap) * sizeof(Window), 1));
              if (roots)
                {
                   int k;