r14219: Fix coverity #135. Don't deref a ptr if it can be NULL.
authorJeremy Allison <jra@samba.org>
Sat, 11 Mar 2006 23:11:24 +0000 (23:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:17 +0000 (11:15 -0500)
Jeremy.

source/rpc_parse/parse_misc.c

index 838006ab58ca15da49b709bf78e6eb2657402e18..8f5ca27365556c8c4d8ef156039d90f9095f8a9f 100644 (file)
@@ -908,7 +908,7 @@ void init_unistr4_w( TALLOC_CTX *ctx, UNISTR4 *uni4, const smb_ucs2_t *buf )
 
 void init_unistr2_w(TALLOC_CTX *ctx, UNISTR2 *str, const smb_ucs2_t *buf)
 {
-       uint32 len = strlen_w(buf);
+       uint32 len = buf ? strlen_w(buf) : 0;
 
        ZERO_STRUCTP(str);