crypto: do not crash if no crypto engine loaded

Do not overflow ops_handlers vector.

Type: fix

Change-Id: I8d5e7fb8125a7bd87ecfe6f4f1390fb9f43dad8f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
(cherry picked from commit 6545df7913b53d71415c7c9643cb824c2ffbaaa7)
This commit is contained in:
Benoît Ganne
2019-11-06 14:21:07 +01:00
committed by Andrew Yourtchenko
parent 7dfe1ac660
commit b1b4b5cf58

View File

@ -134,7 +134,7 @@ vnet_crypto_is_set_handler (vnet_crypto_alg_t alg)
{
vnet_crypto_main_t *cm = &crypto_main;
return (NULL != cm->ops_handlers[alg]);
return (alg < vec_len (cm->ops_handlers) && NULL != cm->ops_handlers[alg]);
}
void