apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Kalu┼ża <jkal...@redhat.com>
Subject [PATCH] unix/sockaddr.c: return error when call_resolver fails and *sa is 0
Date Thu, 02 May 2013 07:01:46 GMT
Hi,

attached patch (against 1.4.6, but works with trunk too) fixes two 
problems I have found in call_resolver function.

1. For unknown reason (probably getaddrinfo bug), getaddrinfo returns 
error EAI_SYSTEM, but errno is set to 0. In this case, we return 0 
(APR_SUCCESS) from call_resolver even when this function failed. This 
leads to httpd crash later, because *sa is NULL, but we return APR_SUCCESS.

Attached patch fixes it by returning APR_EGENERAL in this case.

I was not able to reproduce it myself, but it happens for one Fedora 
user [1]. I have already reported this behaviour to glibc devs and I'm 
waiting for the response now.

2. "while" loop in the same function skips some results retuned by 
getaddrinfo. Theoretically, this part of code can skip all results 
returned by getaddrinfo, so *sa will be NULL, but after this loop, we 
return APR_SUCCESS without checking for this case.

Attached patch fixes it by returning APR_EGENERAL in this case.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=954007

Regards,
Jan Kaluza

Mime
View raw message