Fixes Coverity ID
1476283
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14928)
*/
size_t data_length = p->data_size;
+ if (ret == 0)
+ return 0;
if (data_length >= max_len)
data_length = OPENSSL_strnlen(p->data, data_length);
if (data_length >= max_len)
return 0; /* No space for a terminating NUL byte */
- ((char *)*val)[data_length] = '\0';
+ (*val)[data_length] = '\0';
return ret;
}
const char *expected)
{
OSSL_PARAM *p;
- char *bufp = 0;
+ char *bufp = NULL;
int ret;
ret = TEST_ptr(p = OSSL_PARAM_locate(params, key))