Apply some NULL pointer paranoia to previous wins hook fix.
authorTim Potter <tpot@samba.org>
Mon, 29 Sep 2003 04:57:20 +0000 (04:57 +0000)
committerTim Potter <tpot@samba.org>
Mon, 29 Sep 2003 04:57:20 +0000 (04:57 +0000)
(This used to be commit 0281c5b764971c5300b99b82d89c812ded5a1335)

source3/nmbd/nmbd_winsserver.c

index 804a5aad57bdbe22f15384a04cc3c066659f6423..369407242071c7b14f3c3ab1a12029b5cc8d6823 100644 (file)
@@ -122,8 +122,8 @@ static void wins_hook(const char *operation, struct name_record *namerec, int tt
        /* Use the name without the nametype (and scope) appended */
 
        namestr = nmb_namestr(&namerec->name);
-       p = strchr(namestr, '<');
-       *p = 0;
+       if ((p = strchr(namestr, '<')))
+               *p = 0;
 
        p = command;
        p += slprintf(p, sizeof(command)-1, "%s %s %s %02x %d",