2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

2789. [bug] Fixed an INSIST in dispatch.c [RT #20576]

This commit is contained in:
Evan Hunt 2009-11-25 05:55:32 +00:00
parent f6aa4de371
commit cfc22e53a8
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,5 @@
2789. [bug] Fixed an INSIST in dispatch.c [RT #20576]
2788. [bug] dnssec-signzone could sign with keys that were
not requested [RT #20625]

View File

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dispatch.c,v 1.164 2009/09/01 00:22:26 jinmei Exp $ */
/* $Id: dispatch.c,v 1.165 2009/11/25 05:55:32 each Exp $ */
/*! \file */
@ -778,6 +778,9 @@ new_portentry(dns_dispatch_t *disp, in_port_t port) {
return (portentry);
}
/*%
* The caller must not hold the qid->lock.
*/
static void
deref_portentry(dns_dispatch_t *disp, dispportentry_t **portentryp) {
dispportentry_t *portentry = *portentryp;
@ -785,6 +788,9 @@ deref_portentry(dns_dispatch_t *disp, dispportentry_t **portentryp) {
REQUIRE(disp->port_table != NULL);
REQUIRE(portentry != NULL && portentry->refs > 0);
dns_qid_t *qid;
qid = DNS_QID(disp);
LOCK(&qid->lock);
portentry->refs--;
if (portentry->refs == 0) {
ISC_LIST_UNLINK(disp->port_table[portentry->port %
@ -794,6 +800,7 @@ deref_portentry(dns_dispatch_t *disp, dispportentry_t **portentryp) {
}
*portentryp = NULL;
UNLOCK(&qid->lock);
}
/*%
@ -811,8 +818,9 @@ socket_search(dns_qid_t *qid, isc_sockaddr_t *dest, in_port_t port,
dispsock = ISC_LIST_HEAD(qid->sock_table[bucket]);
while (dispsock != NULL) {
if (isc_sockaddr_equal(dest, &dispsock->host) &&
dispsock->portentry->port == port)
if (dispsock->portentry != NULL &&
dispsock->portentry->port == port &&
isc_sockaddr_equal(dest, &dispsock->host))
return (dispsock);
dispsock = ISC_LIST_NEXT(dispsock, blink);
}