CID 351370 & CID 351371 after ADB refactoring
@each results of ADB refactoring?
*** CID 351370: Program hangs (LOCK)
/lib/dns/adb.c: 2699 in dns_adb_cancelfind()
2693
2694 LOCK(&nbucket->lock);
2695 ISC_LIST_UNLINK(adbname->finds, find, plink);
2696 UNLOCK(&nbucket->lock);
2697
2698 cleanup:
>>> CID 351370: Program hangs (LOCK)
>>> "pthread_mutex_lock" locks "find->lock" while it is locked.
2699 LOCK(&find->lock);
2700 if (!FIND_EVENTSENT(find)) {
2701 ev = &find->event;
2702 task = ev->ev_sender;
2703 ev->ev_sender = find;
2704 ev->ev_type = DNS_EVENT_ADBCANCELED;
*** CID 351371: Null pointer dereferences (REVERSE_INULL)
/lib/dns/adb.c: 2615 in dns_adb_createfind()
2609 /*
2610 * Copy out error flags from the name structure into the find.
2611 */
2612 find->result_v4 = find_err_map[adbname->fetch_err];
2613 find->result_v6 = find_err_map[adbname->fetch6_err];
2614
>>> CID 351371: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "find" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
2615 if (find != NULL) {
2616 if (want_event) {
2617 INSIST((find->flags & DNS_ADBFIND_ADDRESSMASK) != 0);
2618 isc_task_attach(task, &(isc_task_t *){ NULL });
2619 find->event.ev_sender = task;
2620 find->event.ev_action = action;