]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Pulling in rt16318, a set of fixes for 3.1 from Hankins.
authorShane Kerr <shane@isc.org>
Fri, 4 Aug 2006 10:59:33 +0000 (10:59 +0000)
committerShane Kerr <shane@isc.org>
Fri, 4 Aug 2006 10:59:33 +0000 (10:59 +0000)
common/conflex.c
common/options.c
common/parse.c

index 4b8d2358c154e23690fe1819a8f8934505223100..9ae0653300e52e278c1544287ba9d60f56437ee1 100644 (file)
@@ -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"))
index 5060f0caef2aff504ac2d5113a6c8c9f4b5abe67..a9653369e10ce45e092fc6144adf5ee818d2144e 100644 (file)
@@ -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;
index 385023ca307f466f5f4ce980deb316e482ce6e5c..5c7bf71f230bd1943b19c34a0d000074e4f08964 100644 (file)
@@ -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;