Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
baa72abe
Commit
baa72abe
authored
May 21, 2021
by
Deucе
👌🏾
Browse files
Make inet_ptoaddr() not crash and work with IPv4 address strings
parent
baa471f6
Pipeline
#2272
passed with stage
in 10 minutes and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/xpdev/sockwrap.c
src/xpdev/sockwrap.c
+3
-1
No files found.
src/xpdev/sockwrap.c
View file @
baa72abe
...
...
@@ -617,9 +617,11 @@ union xp_sockaddr* inet_ptoaddr(char *addr_str, union xp_sockaddr *addr, size_t
if
(
getaddrinfo
(
addr_str
,
NULL
,
&
hints
,
&
res
))
return
NULL
;
for
(
cur
=
res
;
cur
;
cur
++
)
{
for
(
cur
=
res
;
cur
;
cur
=
cur
->
ai_next
)
{
if
(
cur
->
ai_addr
->
sa_family
==
AF_INET6
)
break
;
if
(
cur
->
ai_addr
->
sa_family
==
AF_INET
)
break
;
}
if
(
!
cur
)
{
freeaddrinfo
(
res
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment