Browse code

bc - adding bc_idx sanity check when running bc lsigs

Mickey Sola authored on 2017/06/22 04:53:14
Showing 1 changed files
... ...
@@ -2771,6 +2771,9 @@ int cli_bytecode_runlsig(cli_ctx *cctx, struct cli_target_info *tinfo,
2771 2771
     const struct cli_bc *bc = &bcs->all_bcs[bc_idx-1];
2772 2772
     struct cli_pe_hook_data pehookdata;
2773 2773
 
2774
+    if (bc_idx == 0) 
2775
+        return CL_ENULLARG;
2776
+
2774 2777
     memset(&ctx, 0, sizeof(ctx));
2775 2778
     cli_bytecode_context_setfuncid(&ctx, bc, 0);
2776 2779
     ctx.hooks.match_counts = lsigcnt;