mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
Bug 615379 - g_new macros crash if sizeof(struct_type) == 0
This commit is contained in:
parent
7b43d2d299
commit
00a7c2e635
@ -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); \
|
||||
|
Loading…
Reference in New Issue
Block a user