build: Fix Subject-line feature list extraction
[vpp.git] / src / vnet / crypto / crypto.c
index 4da8a14..6cd1210 100644 (file)
@@ -118,7 +118,7 @@ vnet_crypto_set_handler (char *alg_name, char *engine)
       vnet_crypto_op_id_t id = ad->op_by_type[i];
       if (id == 0)
        continue;
-      od = vec_elt_at_index (cm->opt_data, id);
+      od = cm->opt_data + id;
       if (ce->ops_handlers[id])
        {
          od->active_engine_index = p[0];
@@ -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