From 6ca9edb1ceda0a87a5d02c366a8a3f85e4a0ca9d Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 17 Nov 2022 17:33:23 +0100 Subject: [PATCH] Fix warning in aflj when parsing vargarg signatures ##anal --- libr/anal/var.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libr/anal/var.c b/libr/anal/var.c index fc53f313c8..298d1d1dde 100644 --- a/libr/anal/var.c +++ b/libr/anal/var.c @@ -1756,13 +1756,18 @@ R_API char *r_anal_function_format_sig(R_NONNULL RAnal *anal, R_NONNULL RAnalFun // This avoids false positives present in argument recovery // and straight away print arguments fetched from types db #if 1 -// TODO: option to filter unsupported types or not for (i = 0; i < argc; i++) { char *type = r_type_func_args_type (TDB, type_fcn_name, i); const char *name = r_type_func_args_name (TDB, type_fcn_name, i); - if (!type || !*type || !name) { - // USE RLOG API - R_LOG_WARN ("Missing type for '%s'", type_fcn_name); + r_str_trim (type); + if (R_STR_ISEMPTY (type) && !strcmp (name, "...")) { + R_LOG_DEBUG ("Detected, but unhandled vararg type"); // TODO implement vararg support + // this is vararg type! + free (type); + type = strdup ("vararg"); + } + if (R_STR_ISEMPTY (type) || R_STR_ISEMPTY (name)) { + R_LOG_WARN ("Missing type for arg %d of function '%s'", i, type_fcn_name); goto beach; } size_t len = strlen (type);