summaryrefslogtreecommitdiff
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 1e3925d46..89b712f2d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: monitor.c,v 1.17 2002/06/22 23:09:51 stevesk Exp $"); 28RCSID("$OpenBSD: monitor.c,v 1.18 2002/06/26 13:20:57 deraadt Exp $");
29 29
30#include <openssl/dh.h> 30#include <openssl/dh.h>
31 31
@@ -1453,9 +1453,13 @@ mm_get_keystate(struct monitor *pmonitor)
1453void * 1453void *
1454mm_zalloc(struct mm_master *mm, u_int ncount, u_int size) 1454mm_zalloc(struct mm_master *mm, u_int ncount, u_int size)
1455{ 1455{
1456 int len = size * ncount;
1456 void *address; 1457 void *address;
1457 1458
1458 address = mm_malloc(mm, size * ncount); 1459 if (len <= 0)
1460 fatal("%s: mm_zalloc(%u, %u)", __func__, ncount, size);
1461
1462 address = mm_malloc(mm, len);
1459 1463
1460 return (address); 1464 return (address);
1461} 1465}