From dad4a7f8f7f9e5023faedefdfcdf0180010fea71 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 27 Jan 2022 13:23:17 +0900 Subject: [PATCH] symtab_findbyvalue: just retun NULL for NULL symtab --- libs/libc/symtab/symtab_findbyvalue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/libc/symtab/symtab_findbyvalue.c b/libs/libc/symtab/symtab_findbyvalue.c index b1ecdaedb2..86ac081932 100644 --- a/libs/libc/symtab/symtab_findbyvalue.c +++ b/libs/libc/symtab/symtab_findbyvalue.c @@ -62,7 +62,11 @@ symtab_findbyvalue(FAR const struct symtab_s *symtab, int low = 0; #endif - DEBUGASSERT(symtab != NULL); + if (symtab == NULL) + { + DEBUGASSERT(nsyms == 0); + return NULL; + } #ifdef CONFIG_SYMTAB_ORDEREDBYVALUE