Skip to content

Commit

Permalink
test/crypto: fix null check for ZUC authentication
Browse files Browse the repository at this point in the history
[ upstream commit e6d37ffa69ac7fb4eec9580af5b005e6c130b79d ]

Check if the returned op is NULL because of failure,
before using it and causing a segmentation fault.

Fixes: 4c99481 ("app/test: add ZUC")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
  • Loading branch information
ciarapow authored and cpaelzer committed Jul 6, 2022
1 parent 386ada6 commit e78ce8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/test/test_cryptodev.c
Expand Up @@ -4591,9 +4591,9 @@ test_snow3g_cipher_auth(const struct snow3g_test_data *tdata)
if (retval < 0)
return retval;

TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
ut_params->op = process_crypto_request(ts_params->valid_devs[0],
ut_params->op);
TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
ut_params->obuf = ut_params->op->sym->m_src;
if (ut_params->obuf)
ciphertext = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
Expand Down

0 comments on commit e78ce8d

Please sign in to comment.