diff options
author | Jeremy Allison <jra@samba.org> | 2006-06-14 00:37:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:26 -0500 |
commit | a5da0a72e1f1e026690df4b149a63754f29e6c28 (patch) | |
tree | 9a9de0676b04550c887dca655bdc087427f84834 /source3/nmbd/nmbd_subnetdb.c | |
parent | d4a80fdf38428c7a0e6cda6da838c8ccc5d8f2ab (diff) | |
download | samba-a5da0a72e1f1e026690df4b149a63754f29e6c28.tar.gz samba-a5da0a72e1f1e026690df4b149a63754f29e6c28.tar.bz2 samba-a5da0a72e1f1e026690df4b149a63754f29e6c28.zip |
r16213: Fix Klocwork #852. iface_n_ip can potentially
return NULL. Ensure we don't deref.
Jeremy.
(This used to be commit c2f0ea2ff2f6ad925cee9c85110c6ad828ffb7a9)
Diffstat (limited to 'source3/nmbd/nmbd_subnetdb.c')
-rw-r--r-- | source3/nmbd/nmbd_subnetdb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c index c3640028d2..5a93d8bec0 100644 --- a/source3/nmbd/nmbd_subnetdb.c +++ b/source3/nmbd/nmbd_subnetdb.c @@ -220,7 +220,13 @@ BOOL create_subnets(void) if (lp_we_are_a_wins_server()) { /* Pick the first interface ip address as the WINS server ip. */ - unicast_ip = *iface_n_ip(0); + struct in_addr *nip = iface_n_ip(0); + + if (!nip) { + return False; + } + + unicast_ip = *nip; } else { /* note that we do not set the wins server IP here. We just set it at zero and let the wins registration code cope |