summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-08 20:02:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:11:07 -0500
commitd8ba987bfe202a4b0676c26cfc6a37a09b897ebf (patch)
tree32cf90ee60108b1c1319f37974598774bae703a5
parent8d1dd8bb96ea6caec651397400a2cce8f37570e3 (diff)
downloadsamba-d8ba987bfe202a4b0676c26cfc6a37a09b897ebf.tar.gz
samba-d8ba987bfe202a4b0676c26cfc6a37a09b897ebf.tar.bz2
samba-d8ba987bfe202a4b0676c26cfc6a37a09b897ebf.zip
r14045: Coverity fix #14. Ensure if len is set buf != NULL.
Jeremy. (This used to be commit fb1a6073321840fecf22f3e0f7541f5ad87f5e49)
-rw-r--r--source3/rpc_parse/parse_misc.c5
1 files changed, 5 insertions, 0 deletions
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;