1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

r14045: Coverity fix #14. Ensure if len is set buf != NULL.

Jeremy.
This commit is contained in:
Jeremy Allison 2006-03-08 20:02:50 +00:00 committed by Gerald (Jerry) Carter
parent f74993e65c
commit fb1a607332

View File

@ -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;