s3-libsmb: Remove check if array is NULL.
authorAndreas Schneider <asn@samba.org>
Wed, 19 Dec 2012 13:10:05 +0000 (14:10 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 21 Dec 2012 12:56:01 +0000 (13:56 +0100)
rdata is an array with data. rdlength defines how big rdata is. So if
rdlength is not set we have a big problem.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source3/libsmb/nmblib.c

index a6816db5b95edca6e051f694d2d63e4252a8b2f1..4adc3da5fab2e3a7127b08e92dd578b34191d3be 100644 (file)
@@ -68,8 +68,9 @@ static void debug_nmb_res_rec(struct res_rec *res, const char *hdr)
                res->rr_class,
                res->ttl ) );
 
-       if( res->rdlength == 0 || res->rdata == NULL )
+       if (res->rdlength == 0) {
                return;
+       }
 
        for (i = 0; i < res->rdlength; i+= MAX_NETBIOSNAME_LEN) {
                DEBUGADD(4, ("    %s %3x char ", hdr, i));