mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-03 13:59:27 -04:00
Merge branch '219-new-coverity-warnings' into 'master'
Resolve "New Coverity Warnings" Closes #219 See merge request isc-projects/bind9!225
This commit is contained in:
commit
63c3a6444b
5 changed files with 30 additions and 20 deletions
|
|
@ -962,9 +962,11 @@ parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
|
|||
static void
|
||||
plus_option(char *option) {
|
||||
isc_result_t result;
|
||||
char *cmd, *value, *last;
|
||||
char *cmd, *value, *last = NULL;
|
||||
isc_boolean_t state = ISC_TRUE;
|
||||
|
||||
INSIST(option != NULL);
|
||||
|
||||
cmd = strtok_r(option, "=", &last);
|
||||
if (cmd == NULL) {
|
||||
printf(";; Invalid option %s\n", option);
|
||||
|
|
|
|||
|
|
@ -735,11 +735,13 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
|||
dig_lookup_t *lookup)
|
||||
{
|
||||
isc_result_t result;
|
||||
char *cmd, *value, *last, *code, *extra;
|
||||
char *cmd, *value, *last = NULL, *code, *extra;
|
||||
isc_uint32_t num;
|
||||
isc_boolean_t state = ISC_TRUE;
|
||||
size_t n;
|
||||
|
||||
INSIST(option != NULL);
|
||||
|
||||
if ((cmd = strtok_r(option, "=", &last)) == NULL) {
|
||||
printf(";; Invalid option %s\n", option);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -3122,6 +3122,10 @@ render_xsl(const char *url, isc_httpdurl_t *urlinfo,
|
|||
const char *if_modified_since = "If-Modified-Since: ";
|
||||
_headers = strdup(headers);
|
||||
|
||||
if (_headers == NULL) {
|
||||
goto send;
|
||||
}
|
||||
|
||||
saveptr = NULL;
|
||||
for (line = strtok_r(_headers, "\n", &saveptr);
|
||||
line;
|
||||
|
|
|
|||
|
|
@ -1025,11 +1025,13 @@ static void
|
|||
plus_option(char *option, struct query *query, isc_boolean_t global)
|
||||
{
|
||||
isc_result_t result;
|
||||
char *cmd, *value, *last, *code;
|
||||
char *cmd, *value, *last = NULL, *code;
|
||||
isc_uint32_t num;
|
||||
isc_boolean_t state = ISC_TRUE;
|
||||
size_t n;
|
||||
|
||||
INSIST(option != NULL);
|
||||
|
||||
if ((cmd = strtok_r(option, "=", &last)) == NULL) {
|
||||
printf(";; Invalid option %s\n", option);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/* $Id: getaddrinfo.c,v 1.3 2009/09/02 23:48:02 tbox Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
/**
|
||||
|
|
@ -1070,22 +1068,24 @@ set_order(int family, int (**net_order)(const char *, int, struct addrinfo **,
|
|||
} else {
|
||||
order = getenv("NET_ORDER");
|
||||
found = 0;
|
||||
last = NULL;
|
||||
for (tok = strtok_r(order, ":", &last);
|
||||
tok;
|
||||
tok = strtok_r(NULL, ":", &last))
|
||||
{
|
||||
if (strcasecmp(tok, "inet6") == 0) {
|
||||
if ((found & FOUND_IPV6) == 0) {
|
||||
*net_order++ = add_ipv6;
|
||||
if (order != NULL) {
|
||||
last = NULL;
|
||||
for (tok = strtok_r(order, ":", &last);
|
||||
tok;
|
||||
tok = strtok_r(NULL, ":", &last))
|
||||
{
|
||||
if (strcasecmp(tok, "inet6") == 0) {
|
||||
if ((found & FOUND_IPV6) == 0) {
|
||||
*net_order++ = add_ipv6;
|
||||
}
|
||||
found |= FOUND_IPV6;
|
||||
} else if (strcasecmp(tok, "inet") == 0 ||
|
||||
strcasecmp(tok, "inet4") == 0) {
|
||||
if ((found & FOUND_IPV4) == 0) {
|
||||
*net_order++ = add_ipv4;
|
||||
}
|
||||
found |= FOUND_IPV4;
|
||||
}
|
||||
found |= FOUND_IPV6;
|
||||
} else if (strcasecmp(tok, "inet") == 0 ||
|
||||
strcasecmp(tok, "inet4") == 0) {
|
||||
if ((found & FOUND_IPV4) == 0) {
|
||||
*net_order++ = add_ipv4;
|
||||
}
|
||||
found |= FOUND_IPV4;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue