diff options
author | Rich Felker <dalias@aerifal.cx> | 2022-09-19 19:12:09 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2022-09-19 19:12:09 -0400 |
commit | dc9285ad1dc19349c407072cc48ba70dab86de45 (patch) | |
tree | b527e634346032ed1f709b6428e1634f8c58ad26 /src/network | |
parent | f9827fc7da55c7b03ea5f36598ce8782c03e9d6e (diff) | |
download | musl-dc9285ad1dc19349c407072cc48ba70dab86de45.tar.gz musl-dc9285ad1dc19349c407072cc48ba70dab86de45.tar.bz2 musl-dc9285ad1dc19349c407072cc48ba70dab86de45.tar.xz musl-dc9285ad1dc19349c407072cc48ba70dab86de45.zip |
fix error cases in gethostbyaddr_r
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).
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/gethostbyaddr_r.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/gethostbyaddr_r.c b/src/network/gethostbyaddr_r.c index 0f1e61aa..ceaf3935 100644 --- a/src/network/gethostbyaddr_r.c +++ b/src/network/gethostbyaddr_r.c @@ -54,10 +54,11 @@ 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: break; |