summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-08-20 18:36:25 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-08-20 18:36:25 +0000
commit0a4f7542da24b870c3d18bedfcbd4c87aa7ebcd3 (patch)
tree58843c57ff628b1e59ebc93167fe87e22ef71938 /monitor.c
parentd730b780716d3955066f9fcc89aa377b31079cff (diff)
- millert@cvs.openbsd.org 2002/08/02 14:43:15
[monitor.c monitor_mm.c] Change mm_zalloc() sanity checks to be more in line with what we do in calloc() and add a check to monitor_mm.c. OK provos@ and markus@
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/monitor.c b/monitor.c
index 7da929c6..8e7ccf89 100644
--- a/monitor.c
+++ b/monitor.c
@@ -25,7 +25,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: monitor.c,v 1.22 2002/07/22 17:32:56 stevesk Exp $");
+RCSID("$OpenBSD: monitor.c,v 1.23 2002/08/02 14:43:15 millert Exp $");
#include <openssl/dh.h>
@@ -1454,10 +1454,10 @@ mm_get_keystate(struct monitor *pmonitor)
void *
mm_zalloc(struct mm_master *mm, u_int ncount, u_int size)
{
- int len = size * ncount;
+ size_t len = size * ncount;
void *address;
- if (len <= 0 || size > 65535 || ncount > 65535)
+ if (len == 0 || ncount > SIZE_T_MAX / size)
fatal("%s: mm_zalloc(%u, %u)", __func__, ncount, size);
address = mm_malloc(mm, len);