From 93d2847bf4cc5d2fcdc95677d1cb1c515adc621c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 19 Dec 2012 14:10:05 +0100 Subject: s3-libsmb: Remove check if array is NULL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Günther Deschner --- source3/libsmb/nmblib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c index a6816db5b9..4adc3da5fa 100644 --- a/source3/libsmb/nmblib.c +++ b/source3/libsmb/nmblib.c @@ -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)); -- cgit