#ifndef lint
static char copyright[] =
-"$Id: conflex.c,v 1.103 2006/07/31 22:19:51 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
+"$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";
#endif /* not lint */
#include "dhcpd.h"
case 's':
if (!strcasecmp(atom + 1, "cript"))
return SCRIPT;
- if (tolower(atom[1]) == 'e') {
+ if (isascii(atom[1]) && tolower(atom[1]) == 'e') {
if (!strcasecmp(atom + 2, "arch"))
return SEARCH;
- if (tolower(atom[2]) == 'c') {
+ if (isascii(atom[2]) && tolower(atom[2]) == 'c') {
if (!strcasecmp(atom + 3, "ond")) {
if (!strcasecmp(atom + 6, "ary"))
return SECONDARY;
return TOKEN_SET;
break;
}
- if (tolower(atom[1]) == 'h') {
+ if (isascii(atom[1]) && tolower(atom[1]) == 'h') {
if (!strcasecmp(atom + 2, "ared-network"))
return SHARED_NETWORK;
if (!strcasecmp(atom + 2, "utdown"))
return SHUTDOWN;
break;
}
- if (tolower(atom[1]) == 'i') {
+ if (isascii(atom[1]) && tolower(atom[1]) == 'i') {
if (!strcasecmp(atom + 2, "addr"))
return SIADDR;
if (!strcasecmp(atom + 2, "gned"))
return SIZE;
break;
}
- if (tolower(atom[1]) == 'p') {
- if (tolower(atom[2]) == 'a') {
+ if (isascii(atom[1]) && tolower(atom[1]) == 'p') {
+ if (isascii(atom[2]) && tolower(atom[2]) == 'a') {
if (!strcasecmp(atom + 3, "ce"))
return SPACE;
if (!strcasecmp(atom + 3, "wn"))
return SPLIT;
break;
}
- if (tolower(atom[1]) == 't') {
- if (tolower(atom[2]) == 'a') {
- if(strncasecmp(atom + 3, "rt", 2)) {
+ if (isascii(atom[1]) && tolower(atom[1]) == 't') {
+ if (isascii(atom[2]) && tolower(atom[2]) == 'a') {
+ if(!strncasecmp(atom + 3, "rt", 2)) {
if (!strcasecmp(atom + 5, "s"))
return STARTS;
if (!strcasecmp(atom + 5, "up"))
return STARTUP;
break;
}
- if (tolower(atom[3]) == 't') {
+ if (isascii(atom[3]) &&
+ tolower(atom[3]) == 't') {
if (!strcasecmp(atom + 4, "e"))
return STATE;
if (!strcasecmp(atom + 4, "ic"))
return SUBSTRING;
break;
}
- if (tolower(atom[1]) == 'u') {
+ if (isascii(atom[1]) && tolower(atom[1]) == 'u') {
if (!strcasecmp(atom + 2, "ffix"))
return SUFFIX;
if (!strcasecmp(atom + 2, "persede"))
#ifndef lint
static char copyright[] =
-"$Id: options.c,v 1.95 2006/07/31 22:19:51 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n";
+"$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";
#endif /* not lint */
#define DHCP_OPTION_DATA
memcpy (bp -> data, buffer, length);
for (offset = 0;
- (offset + universe->tag_size) > length &&
- (code = universe->get_tag(bp->data + offset)) != universe->end; ) {
+ (offset + universe->tag_size) <= length &&
+ (code = universe->get_tag(buffer + offset)) != universe->end; ) {
offset += universe->tag_size;
/* Pad options don't have a length - just skip them. */
continue;
/* Don't look for length if the buffer isn't that big. */
- if (offset + universe->length_size > length) {
+ if ((offset + universe->length_size) > length) {
len = 65536;
goto bogus;
}
- /* All other fields (except end, see above) have a
- one-byte length. */
- len = universe->get_length(bp->data + offset);
+ /* All other fields (except PAD and END handled above)
+ * have a length field.
+ */
+ len = universe->get_length(buffer + offset);
offset += universe->length_size;
#ifndef lint
static char copyright[] =
-"$Id: ddns.c,v 1.22 2006/07/20 16:27:45 shane Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
+"$Id: ddns.c,v 1.23 2006/08/02 22:36:00 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
if (lease -> ip_addr . len != 4)
return 0;
+ memset(&d1, 0, sizeof(d1));
memset (&ddns_hostname, 0, sizeof (ddns_hostname));
memset (&ddns_domainname, 0, sizeof (ddns_domainname));
memset (&old_ddns_fwd_name, 0, sizeof (ddns_fwd_name));
* Compute the RR TTL.
*/
ddns_ttl = DEFAULT_DDNS_TTL;
- memset (&d1, 0, sizeof d1);
if ((oc = lookup_option (&server_universe, state -> options,
SV_DDNS_TTL))) {
if (evaluate_option_cache (&d1, packet, lease,