From: Ted Lemon Date: Thu, 17 Jan 2002 17:01:46 +0000 (+0000) Subject: Detect double-null-terminated hostname - a bug in some Lexmark printers. X-Git-Tag: HEAD-MERGE-V3-0-3B1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7a68a215ffc7a9d0f1d0797f748605ccb13daea;p=thirdparty%2Fdhcp.git Detect double-null-terminated hostname - a bug in some Lexmark printers. --- diff --git a/server/dhcp.c b/server/dhcp.c index 9a3f0baf0..281f215c9 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.195 2001/08/10 10:50:45 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.196 2002/01/17 17:01:46 mellon Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -206,8 +206,8 @@ void dhcp (packet) if ((oc = lookup_option (&dhcp_universe, packet -> options, DHO_HOST_NAME))) { if (!oc -> expression) - if (oc -> data.len && - oc -> data.data [oc -> data.len - 1] == 0) { + while (oc -> data.len && + oc -> data.data [oc -> data.len - 1] == 0) { ms_nulltp = 1; oc -> data.len--; }