[glib] Bug 624968 - div by zero in g_malloc_n family
- From: Behdad Esfahbod <behdad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Bug 624968 - div by zero in g_malloc_n family
- Date: Wed, 21 Jul 2010 20:12:20 +0000 (UTC)
commit 8f80ff02af2fabd22d5aac1d1b853d1ac7865e85
Author: Behdad Esfahbod <behdad behdad org>
Date: Wed Jul 21 16:08:19 2010 -0400
Bug 624968 - div by zero in g_malloc_n family
glib/gmem.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/glib/gmem.c b/glib/gmem.c
index 1e92ffd..2c9b74a 100644
--- a/glib/gmem.c
+++ b/glib/gmem.c
@@ -263,7 +263,7 @@ g_try_realloc (gpointer mem,
}
-#define SIZE_OVERFLOWS(a,b) (G_UNLIKELY ((a) > G_MAXSIZE / (b)))
+#define SIZE_OVERFLOWS(a,b) (G_UNLIKELY ((b) > 0 && (a) > G_MAXSIZE / (b)))
gpointer
g_malloc_n (gsize n_blocks,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]