From: Shane Kerr Date: Fri, 4 Aug 2006 10:59:33 +0000 (+0000) Subject: Pulling in rt16318, a set of fixes for 3.1 from Hankins. X-Git-Tag: v3_1_0a1~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4cba29f04f66320de57e3c10829ff65d7148bb6c;p=thirdparty%2Fdhcp.git Pulling in rt16318, a set of fixes for 3.1 from Hankins. --- diff --git a/common/conflex.c b/common/conflex.c index 4b8d2358c..9ae065330 100644 --- a/common/conflex.c +++ b/common/conflex.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: conflex.c,v 1.104 2006/08/02 22:36:00 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: conflex.c,v 1.105 2006/08/04 10:59:32 shane Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -846,7 +846,7 @@ static enum dhcp_token intern (atom, dfv) return TOKEN_MAX; if (!strcasecmp (atom + 3, "-balance")) return MAX_BALANCE; - if (!strcasecmp (atom + 3, "-lease-")) { + if (!strncasecmp (atom + 3, "-lease-", 7)) { if (!strcasecmp(atom + 10, "misbalance")) return MAX_LEASE_MISBALANCE; if (!strcasecmp(atom + 10, "ownership")) @@ -1024,7 +1024,7 @@ static enum dhcp_token intern (atom, dfv) if (!strcasecmp(atom + 2, "arch")) return SEARCH; if (isascii(atom[2]) && tolower(atom[2]) == 'c') { - if (!strcasecmp(atom + 3, "ond")) { + if (!strncasecmp(atom + 3, "ond", 3)) { if (!strcasecmp(atom + 6, "ary")) return SECONDARY; if (!strcasecmp(atom + 6, "s")) diff --git a/common/options.c b/common/options.c index 5060f0cae..a9653369e 100644 --- a/common/options.c +++ b/common/options.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: options.c,v 1.96 2006/08/02 22:36:00 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: options.c,v 1.97 2006/08/04 10:59:32 shane Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #define DHCP_OPTION_DATA @@ -2702,12 +2702,12 @@ pretty_escape(char **dst, char *dend, const unsigned char **src, /* If there aren't as many bytes left as there are in the source * buffer, don't even bother entering the loop. */ - if (dst == NULL || src == NULL || (*dst >= dend) || (*src > send) || - *dst == NULL || *src == NULL || + if (dst == NULL || dend == NULL || src == NULL || send == NULL || + *dst == NULL || *src == NULL || (*dst >= dend) || (*src > send) || ((send - *src) > (dend - *dst))) return -1; - for ( ; *src < send ; *src++) { + for ( ; *src < send ; (*src)++) { if (!isascii (**src) || !isprint (**src)) { /* Skip trailing NUL. */ if ((*src + 1) != send || **src != '\0') { @@ -2716,7 +2716,7 @@ pretty_escape(char **dst, char *dend, const unsigned char **src, sprintf(*dst, "\\%03o", **src); - *dst += 4; + (*dst) += 4; count += 4; } } else if (**src == '"' || **src == '\'' || **src == '$' || @@ -2725,16 +2725,16 @@ pretty_escape(char **dst, char *dend, const unsigned char **src, return -1; **dst = '\\'; - *dst++; + (*dst)++; **dst = **src; - *dst++; + (*dst)++; count += 2; } else { if (*dst + 1 > dend) return -1; **dst = **src; - *dst++; + (*dst)++; count++; } } @@ -2755,7 +2755,7 @@ pretty_text(char **dst, char *dend, const unsigned char **src, if (emit_quotes) { **dst = '"'; - *dst++; + (*dst)++; } /* dend-1 leaves 1 byte for the closing quote. */ @@ -2766,7 +2766,7 @@ pretty_text(char **dst, char *dend, const unsigned char **src, if (emit_quotes && (*dst < dend)) { **dst = '"'; - *dst++; + (*dst)++; /* Includes quote prior to pretty_escape(); */ count += 2; diff --git a/common/parse.c b/common/parse.c index 385023ca3..5c7bf71f2 100644 --- a/common/parse.c +++ b/common/parse.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.116 2006/07/31 22:19:51 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.117 2006/08/04 10:59:33 shane Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -4992,7 +4992,7 @@ int parse_option_decl (oc, cfile) u_int8_t hunkbuf [1024]; unsigned hunkix = 0; const char *fmt, *f; - struct option *option; + struct option *option=NULL; struct iaddr ip_addr; u_int8_t *dp; unsigned len;