projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f9827fc
)
fix error cases in gethostbyaddr_r
author
Rich Felker
<dalias@aerifal.cx>
Mon, 19 Sep 2022 23:12:09 +0000
(19:12 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 19 Sep 2022 23:12:09 +0000
(19:12 -0400)
EAI_MEMORY is not possible (but would not provide errno if it were)
and EAI_FAIL does not provide errno. treat the latter as EBADMSG to
match how it's handled in gethostbyname2_r (it indicates erroneous or
failure response from the nameserver).
src/network/gethostbyaddr_r.c
patch
|
blob
|
history
diff --git
a/src/network/gethostbyaddr_r.c
b/src/network/gethostbyaddr_r.c
index
0f1e61a
..
ceaf393
100644
(file)
--- a/
src/network/gethostbyaddr_r.c
+++ b/
src/network/gethostbyaddr_r.c
@@
-54,9
+54,10
@@
int gethostbyaddr_r(const void *a, socklen_t l, int af,
case EAI_OVERFLOW:
return ERANGE;
default:
- case EAI_MEMORY:
- case EAI_SYSTEM:
case EAI_FAIL:
+ *err = NO_RECOVERY;
+ return EBADMSG;
+ case EAI_SYSTEM:
*err = NO_RECOVERY;
return errno;
case 0: