bytecode: successfully skip bytecodes that use unknown APIs

When unknown APIs are used, the bytecode is skipped.
However we were still checking that the number of loaded functions is correct,
and of course we were failing because when skipping the number of loaded functions is
0. Fix this by not checking the number of loaded functions when skipping a
bytecode.
remotes/push_mirror/vc9-vt-dnd
Török Edvin 14 years ago
parent 8bfc490990
commit 0796f1cab5
  1. 2
      libclamav/bytecode.c

@ -1558,7 +1558,7 @@ int cli_bytecode_load(struct cli_bc *bc, FILE *f, struct cli_dbio *dbio, int tru
}
free(buffer);
cli_dbgmsg("Parsed %d functions\n", current_func);
if (current_func != bc->num_func) {
if (current_func != bc->num_func && bc->state != bc_skip) {
cli_errmsg("Loaded less functions than declared: %u vs. %u\n",
current_func, bc->num_func);
return CL_EMALFDB;

Loading…
Cancel
Save