Browse Source

test: coverity 1455749 - dereference after null check

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14589)
master
Pauli 9 months ago
parent
commit
8f586f5bc1
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      test/evp_test.c

+ 4
- 3
test/evp_test.c View File

@ -1460,15 +1460,16 @@ static void pkey_test_cleanup(EVP_TEST *t)
static int pkey_test_ctrl(EVP_TEST *t, EVP_PKEY_CTX *pctx,
const char *value)
{
int rv;
int rv = 0;
char *p, *tmpval;
if (!TEST_ptr(tmpval = OPENSSL_strdup(value)))
return 0;
p = strchr(tmpval, ':');
if (p != NULL)
if (p != NULL) {
*p++ = '\0';
rv = EVP_PKEY_CTX_ctrl_str(pctx, tmpval, p);
rv = EVP_PKEY_CTX_ctrl_str(pctx, tmpval, p);
}
if (rv == -2) {
t->err = "PKEY_CTRL_INVALID";
rv = 1;


Loading…
Cancel
Save