- deraadt@cvs.openbsd.org 2002/06/26 13:20:57
[monitor.c]
be careful in mm_zalloc
diff --git a/ChangeLog b/ChangeLog
index aa6a1c8..8dc2ba2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,9 @@
- markus@cvs.openbsd.org 2002/06/26 08:58:26
[session.c]
limit # of env vars to 1000; ok deraadt/djm
+ - deraadt@cvs.openbsd.org 2002/06/26 13:20:57
+ [monitor.c]
+ be careful in mm_zalloc
- (djm) Require krb5 devel for RPM build w/ KrbV
- (djm) Improve PAMAuthenticationViaKbdInt text from Nalin Dahyabhai
<nalin@redhat.com>
@@ -1150,4 +1153,4 @@
- (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
-$Id: ChangeLog,v 1.2295 2002/06/26 13:05:16 djm Exp $
+$Id: ChangeLog,v 1.2296 2002/06/26 13:27:11 djm Exp $
diff --git a/monitor.c b/monitor.c
index 1e3925d..89b712f 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 @@
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);
}