summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-06-26 23:27:11 +1000
committerDamien Miller <djm@mindrot.org>2002-06-26 23:27:11 +1000
commit530a754d389723a5617dc5ce103a9057e6293708 (patch)
tree92eaca491ddf7f4e424f8fb955c89e6b594e7266 /monitor.c
parent136d4418e3366bae92e5f1472a0251efc5e2804c (diff)
- deraadt@cvs.openbsd.org 2002/06/26 13:20:57
[monitor.c] be careful in mm_zalloc
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index 1e3925d4..89b712f2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -25,7 +25,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: monitor.c,v 1.17 2002/06/22 23:09:51 stevesk Exp $");
+RCSID("$OpenBSD: monitor.c,v 1.18 2002/06/26 13:20:57 deraadt Exp $");
#include <openssl/dh.h>
@@ -1453,9 +1453,13 @@ mm_get_keystate(struct monitor *pmonitor)
void *
mm_zalloc(struct mm_master *mm, u_int ncount, u_int size)
{
+ int len = size * ncount;
void *address;
- address = mm_malloc(mm, size * ncount);
+ if (len <= 0)
+ fatal("%s: mm_zalloc(%u, %u)", __func__, ncount, size);
+
+ address = mm_malloc(mm, len);
return (address);
}