summaryrefslogtreecommitdiff
path: root/evutil.c
diff options
context:
space:
mode:
authorMichael Madsen <mkm85@users.noreply.github.com>2022-11-04 01:59:17 -0700
committerGitHub <noreply@github.com>2022-11-04 11:59:17 +0300
commitff99f67a1ab7b7e9a0c82dd987317bb1df38bdb7 (patch)
tree37367682b82289fff60b33c561e02d3eb430c678 /evutil.c
parent3ec3b469b8d091837a1d1309ac0cdffa6a76e1d4 (diff)
downloadlibevent-ff99f67a1ab7b7e9a0c82dd987317bb1df38bdb7.tar.gz
fixed missing check for null after strdup in evutil_inet_pton_scope (#1366)
Diffstat (limited to 'evutil.c')
-rw-r--r--evutil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/evutil.c b/evutil.c
index ae862ee1..2876721a 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);