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 );
|
||||
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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue