Commit fb1933f5 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

Issue#7530 - Test for ERANGE when using 6 form gethostbyname_r

parent c70e2e08
Pipeline #406 passed with stage
in 29 minutes and 16 seconds
......@@ -445,8 +445,12 @@ int ldap_pvt_gethostbyname_a(
*result=gethostbyname_r( name, resbuf, *buf, buflen, herrno_ptr );
r = (*result == NULL) ? -1 : 0;
#else
r = gethostbyname_r( name, resbuf, *buf,
buflen, result, herrno_ptr );
while((r = gethostbyname_r( name, resbuf, *buf, buflen, result, herrno_ptr )) == ERANGE) {
/* Increase the buffer */
buflen*=2;
if (safe_realloc(buf, buflen) == NULL)
return -1;
}
#endif
Debug2( LDAP_DEBUG_TRACE, "ldap_pvt_gethostbyname_a: host=%s, r=%d\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment