diff options
author | Jeremy Allison <jra@samba.org> | 2006-03-06 17:47:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:57 -0500 |
commit | fa94300f5fd3b115cebe1604d8c002e6b669b472 (patch) | |
tree | 9971d175a45ab0a5a5226f51178aca65916740e3 /source3 | |
parent | 0a516662abf927f96a66abb65034edab639b2682 (diff) | |
download | samba-fa94300f5fd3b115cebe1604d8c002e6b669b472.tar.gz samba-fa94300f5fd3b115cebe1604d8c002e6b669b472.tar.bz2 samba-fa94300f5fd3b115cebe1604d8c002e6b669b472.zip |
r13875: Fix coverity bug #148. Deref of rrec before NULL check.
Jeremy.
(This used to be commit 0f1dffb2f2ce5ace1b3216f578ab115c976624c7)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/nmbd/nmbd_winsproxy.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/nmbd/nmbd_winsproxy.c b/source3/nmbd/nmbd_winsproxy.c index d6dc6261c8..a31eb1e2a6 100644 --- a/source3/nmbd/nmbd_winsproxy.c +++ b/source3/nmbd/nmbd_winsproxy.c @@ -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(); } |