mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Issue#7530 - Test for ERANGE when using 6 form gethostbyname_r
This commit is contained in:
parent
c70e2e0869
commit
fb1933f567
1 changed files with 6 additions and 2 deletions
|
|
@ -445,8 +445,12 @@ int ldap_pvt_gethostbyname_a(
|
||||||
*result=gethostbyname_r( name, resbuf, *buf, buflen, herrno_ptr );
|
*result=gethostbyname_r( name, resbuf, *buf, buflen, herrno_ptr );
|
||||||
r = (*result == NULL) ? -1 : 0;
|
r = (*result == NULL) ? -1 : 0;
|
||||||
#else
|
#else
|
||||||
r = gethostbyname_r( name, resbuf, *buf,
|
while((r = gethostbyname_r( name, resbuf, *buf, buflen, result, herrno_ptr )) == ERANGE) {
|
||||||
buflen, result, herrno_ptr );
|
/* Increase the buffer */
|
||||||
|
buflen*=2;
|
||||||
|
if (safe_realloc(buf, buflen) == NULL)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Debug2( LDAP_DEBUG_TRACE, "ldap_pvt_gethostbyname_a: host=%s, r=%d\n",
|
Debug2( LDAP_DEBUG_TRACE, "ldap_pvt_gethostbyname_a: host=%s, r=%d\n",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue