2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 21:47:59 +00:00

4104. [bug] Address uninitialized elements. [RT #39252]

This commit is contained in:
Mark Andrews 2015-04-17 14:04:47 +10:00
parent 8f1ca2e8ff
commit f1a261ba2d
6 changed files with 24 additions and 15 deletions

View File

@ -1,3 +1,5 @@
4104. [bug] Address uninitialized elements. [RT #39252]
4103. [port] Misc fixes for Microsoft Visual Studio
2015 CTP6. [RT #39267]

View File

@ -289,30 +289,30 @@ $RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 loadkeys . | sed 's/^/I: ns1 /
sleep 3
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 managed-keys refresh | sed 's/^/I: ns2 /'
sleep 1
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 managed-keys status > rndc.out.$n 2>&1
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 managed-keys status > rndc.out.a.$n 2>&1
# four keys listed
count=`grep -c "keyid: " rndc.out.$n`
count=`grep -c "keyid: " rndc.out.a.$n`
[ "$count" -eq 4 ] || ret=1
# one revoked
count=`grep -c "trust revoked" rndc.out.$n`
count=`grep -c "trust revoked" rndc.out.a.$n`
[ "$count" -eq 1 ] || ret=1
# two pending
count=`grep -c "trust pending" rndc.out.$n`
count=`grep -c "trust pending" rndc.out.a.$n`
[ "$count" -eq 2 ] || ret=1
$SETTIME -R now -K ns1 $standby3 > /dev/null
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 loadkeys . | sed 's/^/I: ns1 /'
sleep 3
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 managed-keys refresh | sed 's/^/I: ns2 /'
sleep 1
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 managed-keys status > rndc.out.$n 2>&1
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 managed-keys status > rndc.out.b.$n 2>&1
# now three keys listed
count=`grep -c "keyid: " rndc.out.$n`
count=`grep -c "keyid: " rndc.out.b.$n`
[ "$count" -eq 3 ] || ret=1
# one revoked
count=`grep -c "trust revoked" rndc.out.$n`
count=`grep -c "trust revoked" rndc.out.b.$n`
[ "$count" -eq 1 ] || ret=1
# one pending
count=`grep -c "trust pending" rndc.out.$n`
count=`grep -c "trust pending" rndc.out.b.$n`
[ "$count" -eq 1 ] || ret=1
$SETTIME -D now -K ns1 $standby3 > /dev/null
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 loadkeys . | sed 's/^/I: ns1 /'
@ -424,18 +424,18 @@ $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 managed-keys sync | sed 's/^/I
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 managed-keys status > rndc.out.$n 2>&1
# one key listed
count=`grep -c "keyid: " rndc.out.$n`
[ "$count" -eq 1 ] || ret=1
[ "$count" -eq 1 ] || { echo "'keyid:' count != 1"; ret=1; }
# it's the original key id
count=`grep -c "keyid: $keyid" rndc.out.$n`
[ "$count" -eq 1 ] || ret=1
[ "$count" -eq 1 ] || { echo "'keyid: $keyid' count != 1"; ret=1; }
# not revoked
count=`grep -c "REVOKE" rndc.out.$n`
[ "$count" -eq 0 ] || ret=1
[ "$count" -eq 0 ] || { echo "'REVOKE' count != 0"; ret=1; }
# trust is still current
count=`grep -c "trust" rndc.out.$n`
[ "$count" -eq 1 ] || ret=1
[ "$count" -eq 1 ] || { echo "'trust' count != 1"; ret=1; }
count=`grep -c "trusted since" rndc.out.$n`
[ "$count" -eq 1 ] || ret=1
[ "$count" -eq 1 ] || { echo "'trusted since' count != 1"; ret=1; }
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`

View File

@ -1555,6 +1555,7 @@ static inline void
init_rdataset(dns_rbtdb_t *rbtdb, rdatasetheader_t *h) {
ISC_LINK_INIT(h, link);
h->heap_index = 0;
h->rdh_ttl = 0;
h->is_mmapped = 0;
h->next_is_relative = 0;
h->node_is_relative = 0;

View File

@ -1050,6 +1050,7 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
zone->rss_oldver = NULL;
zone->rss_event = NULL;
zone->rss_state = NULL;
zone->updatemethod = dns_updatemethod_increment;
zone->magic = ZONE_MAGIC;
@ -3844,6 +3845,8 @@ update_soa_serial(dns_db_t *db, dns_dbversion_t *ver, dns_diff_t *diff,
isc_uint32_t serial;
isc_result_t result;
INSIST(method != dns_updatemethod_none);
CHECK(dns_db_createsoatuple(db, ver, mctx, DNS_DIFFOP_DEL, &deltuple));
CHECK(dns_difftuple_copy(deltuple, &addtuple));
addtuple->op = DNS_DIFFOP_ADD;

View File

@ -2267,6 +2267,7 @@ allocate_socket(isc__socketmgr_t *manager, isc_sockettype_t type,
sock->dscp = 0; /* TOS/TCLASS is zero until set. */
sock->dupped = 0;
sock->statsindex = NULL;
sock->active = 0;
ISC_LINK_INIT(sock, link);
@ -2943,7 +2944,6 @@ socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type,
INSIST(0);
}
sock->active = 0;
sock->pf = pf;
result = opensocket(manager, sock, (isc__socket_t *)dup_socket);

View File

@ -785,7 +785,10 @@ parse_serverid(cfg_parser_t *pctx, const cfg_type_t *type,
return (cfg_create_obj(pctx, &cfg_type_none, ret));
if (pctx->token.type == isc_tokentype_string &&
strcasecmp(TOKEN_STRING(pctx), "hostname") == 0) {
return (cfg_create_obj(pctx, &cfg_type_hostname, ret));
result = cfg_create_obj(pctx, &cfg_type_hostname, ret);
if (result == ISC_R_SUCCESS)
(*ret)->value.boolean = ISC_TRUE;
return (result);
}
cfg_ungettoken(pctx);
return (cfg_parse_qstring(pctx, type, ret));