]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Don't call memset with a length of zero.
authorTed Lemon <source@isc.org>
Tue, 24 Nov 1998 22:35:43 +0000 (22:35 +0000)
committerTed Lemon <source@isc.org>
Tue, 24 Nov 1998 22:35:43 +0000 (22:35 +0000)
common/parse.c

index 97bfa877b17e4ccb26f4d2748d3dbfd9ca0fec5e..f25685c1305eec30aec39d6e97955679c88ad9b8 100644 (file)
@@ -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);
        }