summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-07-30 22:39:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-07-30 22:39:36 +0000
commit0fa406b64f78d8d3f07b2e4285d5cf5d79ce5440 (patch)
tree590c063f09418f80cfcb1b26b8a3af7c9cd154db /usr.sbin
parent5fa8930468f5ec5d64ce160e40caf7f779ce617d (diff)
for the disabled DSTORAGE option, fix the local calloc() here in the same way as libc; eugene@securityarchitects.com
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/named/named/storage.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/named/named/storage.c b/usr.sbin/named/named/storage.c
index 0fda2ac6a9c..b71f8a41966 100644
--- a/usr.sbin/named/named/storage.c
+++ b/usr.sbin/named/named/storage.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: storage.c,v 1.5 2002/06/09 01:58:54 kjell Exp $ */
+/* $OpenBSD: storage.c,v 1.6 2002/07/30 22:39:35 deraadt Exp $ */
/*
* ++Copyright++ 1985, 1989
@@ -58,6 +58,8 @@
#include <sys/types.h>
#include <sys/param.h>
#include <syslog.h>
+#include <limits.h>
+#include <errno.h>
#include "../conf/portability.h"
#include "../conf/options.h"
@@ -190,6 +192,10 @@ calloc(num, size)
{
register char *p;
+ if (SIZE_T_MAX / num < size) {
+ errno = ENOMEM;
+ return NULL;
+ }
size *= num;
if (p = rt_malloc(size))
bzero(p, size);