Commit 00a7c2e6 authored by Behdad Esfahbod's avatar Behdad Esfahbod

Bug 615379 - g_new macros crash if sizeof(struct_type) == 0

parent 7b43d2d2
......@@ -88,7 +88,7 @@ gpointer g_try_realloc_n (gpointer mem,
if (__s == 1) \
__p = g_##func (__n); \
else if (__builtin_constant_p (__n) && \
__n <= G_MAXSIZE / __s) \
(__s == 0 || __n <= G_MAXSIZE / __s)) \
__p = g_##func (__n * __s); \
else \
__p = g_##func##_n (__n, __s); \
......@@ -102,7 +102,7 @@ gpointer g_try_realloc_n (gpointer mem,
if (__s == 1) \
__p = g_##func (__p, __n); \
else if (__builtin_constant_p (__n) && \
__n <= G_MAXSIZE / __s) \
(__s == 0 || __n <= G_MAXSIZE / __s)) \
__p = g_##func (__p, __n * __s); \
else \
__p = g_##func##_n (__p, __n, __s); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment