11494, 12047, 13058, 13525, 13526, 13527, 13528, 13529, 13530, 13531,
13532, 13533, 13547, 13551, 13552, 13553, 13555, 13559, 13566, 13583,
13618, 13637, 13656, 13658, 13673, 13695, 13704, 13706, 13726, 13738,
- 13786, 13792, 13806, 13824, 13840, 13841, 13844, 13846, 13851, 13852,
- 13854, 13871, 13879, 13883, 13892, 13910, 13911, 13912, 13913, 13915,
- 13916, 13917, 13918, 13919, 13920, 13921
+ 13760, 13786, 13792, 13806, 13824, 13840, 13841, 13844, 13846, 13851,
+ 13852, 13854, 13871, 13879, 13883, 13892, 13910, 13911, 13912, 13913,
+ 13915, 13916, 13917, 13918, 13919, 13920, 13921
* ISO C11 support:
&first);
if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
|| (status == NSS_STATUS_TRYAGAIN
- && (errno != ERANGE || *h_errnop != NO_RECOVERY)))
+ /* We want to look at the second answer in case of an
+ NSS_STATUS_TRYAGAIN only if the error is non-recoverable, i.e.
+ *h_errnop is NO_RECOVERY. If not, and if the failure was due to
+ an insufficient buffer (ERANGE), then we need to drop the results
+ and pass on the NSS_STATUS_TRYAGAIN to the caller so that it can
+ repeat the query with a larger buffer. */
+ && (*errnop != ERANGE || *h_errnop == NO_RECOVERY)))
&& answer2 != NULL && anslen2 > 0)
{
enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname,