mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-05-16 03:25:05 -04:00
generates fmap from desc if no map is NULL
This commit is contained in:
@@ -3476,9 +3476,25 @@ static int scan_common(int desc, cl_fmap_t *map, const char **virname, unsigned
|
||||
rc = CL_EMEM;
|
||||
}
|
||||
else {
|
||||
cli_bytecode_context_setctx(bc_ctx, &ctx);
|
||||
rc = cli_bytecode_runhook(&ctx, ctx.engine, bc_ctx, BC_PRECLASS, map);
|
||||
cli_bytecode_context_destroy(bc_ctx);
|
||||
fmap_t *pc_map = map;
|
||||
|
||||
if (!pc_map) {
|
||||
perf_start(&ctx, PERFT_MAP);
|
||||
if(!(pc_map = fmap(desc, 0, sb.st_size))) {
|
||||
perf_stop(&ctx, PERFT_MAP);
|
||||
rc = CL_EMEM;
|
||||
}
|
||||
perf_stop(&ctx, PERFT_MAP);
|
||||
}
|
||||
|
||||
if (pc_map) {
|
||||
cli_bytecode_context_setctx(bc_ctx, &ctx);
|
||||
rc = cli_bytecode_runhook(&ctx, ctx.engine, bc_ctx, BC_PRECLASS, pc_map);
|
||||
cli_bytecode_context_destroy(bc_ctx);
|
||||
|
||||
if (!map)
|
||||
funmap(pc_map);
|
||||
}
|
||||
}
|
||||
//ctx.options &= ~CL_SCAN_FILE_PROPERTIES;
|
||||
//rc = cli_mem_scandesc(jstring, strlen(jstring), &ctx);
|
||||
|
||||
Reference in New Issue
Block a user