Updated to fedora-glibc-20060501T0751
[kopensolaris-gnu/glibc.git] / nis / nss_nisplus / nisplus-proto.c
index 0b96153..42a2d08 100644 (file)
@@ -227,6 +227,11 @@ internal_nisplus_getprotoent_r (struct protoent *proto, char *buffer,
            }
 
          result = nis_first_entry (tablename_val);
+         if (result == NULL)
+           {
+             *errnop = errno;
+             return NSS_STATUS_TRYAGAIN;
+           }
          if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
            return niserr2nss (result->status);
        }
@@ -234,7 +239,11 @@ internal_nisplus_getprotoent_r (struct protoent *proto, char *buffer,
        {
          saved_res = result;
          result = nis_next_entry (tablename_val, &result->cookie);
-
+         if (result == NULL)
+           {
+             *errnop = errno;
+             return NSS_STATUS_TRYAGAIN;
+           }
          if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
            {
              nis_freeresult (saved_res);