From: Ted Lemon Date: Tue, 24 Nov 1998 22:35:43 +0000 (+0000) Subject: Don't call memset with a length of zero. X-Git-Tag: V2-BETA-1-PATCH-7~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0e4e051b24769cf8730b7f1e5c72952559e0380c;p=thirdparty%2Fdhcp.git Don't call memset with a length of zero. --- diff --git a/common/parse.c b/common/parse.c index 97bfa877b..f25685c13 100644 --- a/common/parse.c +++ b/common/parse.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.2.2.1 1998/06/25 21:11:31 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.2.2.2 1998/11/24 22:35:43 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -247,6 +247,9 @@ void parse_hardware_param (cfile, hardware) hardware -> hlen = hlen; memcpy ((unsigned char *)&hardware -> haddr [0], t, hardware -> hlen); + if (hlen < sizeof hardware -> haddr) + memset (&hardware -> haddr [hlen], 0, + (sizeof hardware -> haddr) - hlen); free (t); }