From 7bb809483c139d98b0596c41024c28d5ecdd9985 Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Tue, 30 May 2000 21:43:42 +0000 Subject: [PATCH] Fix a buffer overflow problem (not a security issue). Thanks to Joe. --- client/dhclient.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/dhclient.c b/client/dhclient.c index 9cd88994..91da4d2a 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -41,7 +41,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhclient.c,v 1.103 2000/05/30 21:17:04 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n"; +"$Id: dhclient.c,v 1.104 2000/05/30 21:43:42 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -179,6 +179,9 @@ int main (argc, argv, envp) if (status != ISC_R_SUCCESS) log_fatal ("Can't record interface %s:%s", argv [i], isc_result_totext (status)); + if (strlen (argv [i]) > sizeof tmp -> name) + log_fatal ("%s: interface name too long (max %d)", + argv [i], strlen (argv [i])); strcpy (tmp -> name, argv [i]); if (interfaces) { interface_reference (&tmp -> next,