mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
fixed missing check for null after strdup in evutil_inet_pton_scope (#1366)
This commit is contained in:
parent
3ec3b469b8
commit
ff99f67a1a
4
evutil.c
4
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user