1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r17864: Fix possible null deref if client doesn't give us

an answer record. Found by the Stanford checker.
Jeremy.
(This used to be commit 1ec77c5011)
This commit is contained in:
Jeremy Allison 2006-08-28 02:13:50 +00:00 committed by Gerald (Jerry) Carter
parent 6ee700bd65
commit 6f9ce7def7

View File

@ -59,7 +59,15 @@ static void query_name_response( struct subnet_record *subrec,
rrec->repeat_count = 0;
/* How long we should wait for. */
rrec->repeat_time = p->timestamp + nmb->answers->ttl;
if (nmb->answers) {
rrec->repeat_time = p->timestamp + nmb->answers->ttl;
} else {
/* No answer - this is probably a corrupt
packet.... */
DEBUG(0,("query_name_response: missing answer record in "
"NMB_WACK_OPCODE response.\n"));
rrec->repeat_time = p->timestamp + 10;
}
rrec->num_msgs--;
return;
} else if(nmb->header.rcode != 0) {