From 23c3cc05f1c6f586b54ac0aade6e2f014312cdf3 Mon Sep 17 00:00:00 2001 From: "Val S." Date: Sat, 4 Oct 2025 22:33:01 -0400 Subject: [PATCH] Windows: fix number of arguments in function call (#1586) Fix the number of NULL arguments in `scanmem.c` call to `cl_scandesc_ex()`. --- common/scanmem.c | 13 ++++++------- examples/ex_scan_callbacks.c | 13 ++++++------- libclamav/scanners.c | 22 +++++++++++----------- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/common/scanmem.c b/common/scanmem.c index 96742a966..9a6a62a3d 100644 --- a/common/scanmem.c +++ b/common/scanmem.c @@ -572,13 +572,12 @@ int scanfile(const char *filename, scanmem_data *scan_data, struct mem_info *inf &info->bytes_scanned, info->engine, info->options, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL); + NULL, // void *context, + NULL, // const char *hash_hint, + NULL, // char **hash_out, + NULL, // const char *hash_alg, + NULL, // const char *file_type_hint, + NULL); // char **file_type_out); switch (verdict) { case CL_VERDICT_NOTHING_FOUND: { diff --git a/examples/ex_scan_callbacks.c b/examples/ex_scan_callbacks.c index d110f8358..df4b27957 100644 --- a/examples/ex_scan_callbacks.c +++ b/examples/ex_scan_callbacks.c @@ -1445,13 +1445,12 @@ int main(int argc, char **argv) &size, engine, &options, - script_context, // context, - hash_hint, // hash_hint, - &hash_out, // hash_out, - hash_alg, // hash_alg, - file_type_hint, // file_type_hint, - &file_type_out // file_type_out - ); + script_context, + hash_hint, + &hash_out, + hash_alg, + file_type_hint, + &file_type_out); /* Calculate size of scanned data */ printf("\n"); diff --git a/libclamav/scanners.c b/libclamav/scanners.c index 21db3ba17..fc19cc63e 100644 --- a/libclamav/scanners.c +++ b/libclamav/scanners.c @@ -6255,12 +6255,12 @@ cl_error_t cl_scandesc( &scanned_out, engine, scanoptions, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL); + NULL, // void *context, + NULL, // const char *hash_hint, + NULL, // char **hash_out, + NULL, // const char *hash_alg, + NULL, // const char *file_type_hint, + NULL); // char **file_type_out); if (NULL != scanned) { if ((SIZEOF_LONG == 4) && @@ -6303,11 +6303,11 @@ cl_error_t cl_scandesc_callback( engine, scanoptions, context, - NULL, - NULL, - NULL, - NULL, - NULL); + NULL, // const char *hash_hint, + NULL, // char **hash_out, + NULL, // const char *hash_alg, + NULL, // const char *file_type_hint, + NULL); // char **file_type_out); if (NULL != scanned) { if ((SIZEOF_LONG == 4) &&