From ff99f67a1ab7b7e9a0c82dd987317bb1df38bdb7 Mon Sep 17 00:00:00 2001 From: Michael Madsen Date: Fri, 4 Nov 2022 01:59:17 -0700 Subject: [PATCH] fixed missing check for null after strdup in evutil_inet_pton_scope (#1366) --- evutil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evutil.c b/evutil.c index ae862ee104..2876721a5e 100644 --- a/evutil.c +++ b/evutil.c @@ -2248,7 +2248,9 @@ evutil_inet_pton_scope(int af, const char *src, void *dst, unsigned *indexp) return 0; } *indexp = if_index; - tmp_src = mm_strdup(src); + if (!(tmp_src = mm_strdup(src)) { + return -1; + } cp = strchr(tmp_src, '%'); *cp = '\0'; r = evutil_inet_pton(af, tmp_src, dst);