From 86c60cbea038f9916c0f9943cfeebd6d8abe599a Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Tue, 24 Apr 2001 01:02:24 +0000 Subject: [PATCH] Don't malloc zero-length uid buffer. --- server/mdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/mdb.c b/server/mdb.c index ab131f7b..741fd9bc 100644 --- a/server/mdb.c +++ b/server/mdb.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: mdb.c,v 1.61 2001/04/24 00:55:31 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: mdb.c,v 1.62 2001/04/24 01:02:24 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1234,6 +1234,8 @@ int lease_copy (struct lease **lp, if (lease -> uid == lease -> uid_buf) { lt -> uid = lt -> uid_buf; memcpy (lt -> uid_buf, lease -> uid_buf, sizeof lt -> uid_buf); + } else if (!lease -> uid_max) { + lt -> uid = (unsigned char *)0; } else { lt -> uid = dmalloc (lt -> uid_max, MDL); if (!lt -> uid) {