diff --git a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c index 4987a9d833..17e9f59700 100644 --- a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c +++ b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c @@ -74,6 +74,9 @@ ns_lookup_list_search(char **list, const char *host) { size_t host_len = strlen(host), suffix_len; + if (!list) + return false; + while (*list) { if (*list[0] == '*') { suffix_len = strlen(*list) - 1;