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

r13875: Fix coverity bug #148. Deref of rrec before NULL check.

Jeremy.
(This used to be commit 0f1dffb2f2)
This commit is contained in:
Jeremy Allison 2006-03-06 17:47:21 +00:00 committed by Gerald (Jerry) Carter
parent 0a516662ab
commit fa94300f5f

View File

@ -49,7 +49,12 @@ static void wins_proxy_name_query_request_success( struct subnet_record *subrec,
nb_flags = get_nb_flags( rrec->rdata );
num_ips = rrec->rdlength / 6;
if (rrec) {
num_ips = rrec->rdlength / 6;
} else {
num_ips = 0;
}
if(num_ips == 0) {
DEBUG(0,("wins_proxy_name_query_request_success: Invalid number of IP records (0) \
returned for name %s.\n", nmb_namestr(nmbname) ));
@ -71,7 +76,7 @@ returned for name %s.\n", nmb_namestr(nmbname) ));
/* Add the queried name to the original subnet as a WINS_PROXY_NAME. */
if(rrec == PERMANENT_TTL) {
if(rrec && (rrec == PERMANENT_TTL)) {
ttl = lp_max_ttl();
}