From e0767dcd91c7c43aab09d85d64bc3e375c9c359e Mon Sep 17 00:00:00 2001 From: astralia Date: Mon, 28 Oct 2024 10:51:22 +0100 Subject: [PATCH] Check anplugs APIs nullability for #23490 --- libr/anal/anplugs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libr/anal/anplugs.c b/libr/anal/anplugs.c index 623376b97b27a..263f615b03ca3 100644 --- a/libr/anal/anplugs.c +++ b/libr/anal/anplugs.c @@ -76,6 +76,7 @@ static const SdbGperf *gperfs_types[] = { }; R_API SdbGperf *r_anal_get_gperf_cc(const char *k) { + R_RETURN_VAL_IF_FAIL (k, NULL); SdbGperf **gp = (SdbGperf**)gperfs_cc; char *kk = strdup (k); r_str_replace_char (kk, '_', '-'); @@ -92,6 +93,7 @@ R_API SdbGperf *r_anal_get_gperf_cc(const char *k) { } R_API SdbGperf *r_anal_get_gperf_types(const char *k) { + R_RETURN_VAL_IF_FAIL (k, NULL); SdbGperf **gp = (SdbGperf**)gperfs_types; char *s = strdup (k); r_str_replace_char (s, '-', '_'); @@ -107,11 +109,11 @@ R_API SdbGperf *r_anal_get_gperf_types(const char *k) { return NULL; } #else -R_API SdbGperf *r_anal_get_gperf_cc(const char *k) { +R_API SdbGperf *r_anal_get_gperf_cc(R_NULLABLE const char *k) { return NULL; } -R_API SdbGperf *r_anal_get_gperf_types(const char *k) { +R_API SdbGperf *r_anal_get_gperf_types(R_NULLABLE const char *k) { return NULL; } #endif