From d8ba987bfe202a4b0676c26cfc6a37a09b897ebf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 8 Mar 2006 20:02:50 +0000 Subject: r14045: Coverity fix #14. Ensure if len is set buf != NULL. Jeremy. (This used to be commit fb1a6073321840fecf22f3e0f7541f5ad87f5e49) --- source3/rpc_parse/parse_misc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/rpc_parse/parse_misc.c') diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index f030e266df..838006ab58 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -762,6 +762,11 @@ void init_string2(STRING2 *str, const char *buf, size_t max_len, size_t str_len) /* set up string lengths. */ SMB_ASSERT(max_len >= str_len); + /* Ensure buf is valid if str_len was set. Coverity check. */ + if (str_len && !buf) { + return; + } + str->str_max_len = max_len; str->offset = 0; str->str_str_len = str_len; -- cgit