* nis/nss_nisplus/nisplus-ethers.c: Add missing null pointer check.

* nis/nss_nisplus/nisplus-hosts.c: Likewise.
	* nis/nss_nisplus/nisplus-network.c: Likewise.
	* nis/nss_nisplus/nisplus-proto.c: Likewise.
	* nis/nss_nisplus/nisplus-rpc.c: Likewise.
	* nis/nss_nisplus/nisplus-service.c: Likewise.
	* nis/nss_nisplus/nisplus-spwd.c: Likewise.
This commit is contained in:
Ulrich Drepper 2006-04-30 05:45:15 +00:00
parent d08a1d404d
commit 487609e313
8 changed files with 80 additions and 7 deletions

View File

@ -1,5 +1,13 @@
2006-04-29 Ulrich Drepper <drepper@redhat.com>
* nis/nss_nisplus/nisplus-ethers.c: Add missing null pointer check.
* nis/nss_nisplus/nisplus-hosts.c: Likewise.
* nis/nss_nisplus/nisplus-network.c: Likewise.
* nis/nss_nisplus/nisplus-proto.c: Likewise.
* nis/nss_nisplus/nisplus-rpc.c: Likewise.
* nis/nss_nisplus/nisplus-service.c: Likewise.
* nis/nss_nisplus/nisplus-spwd.c: Likewise.
* nis/nisplus-parser.h (_nss_nisplus_parse_pwent): Add entry
parameter.
(_nss_nisplus_parse_pwent_chk): New prototype.

View File

@ -176,6 +176,11 @@ internal_nisplus_getetherent_r (struct etherent *ether, char *buffer,
{
saved_result = NULL;
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);
}
@ -183,6 +188,11 @@ internal_nisplus_getetherent_r (struct etherent *ether, char *buffer,
{
saved_result = 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_result);

View File

@ -265,6 +265,11 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
}
result = nis_first_entry (tablename_val);
if (result == NULL)
{
*errnop = errno;
return NSS_STATUS_TRYAGAIN;
}
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
{
enum nss_status retval = niserr2nss (result->status);
@ -279,11 +284,13 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
}
else
{
nis_result *res2;
saved_res = result;
res2 = nis_next_entry(tablename_val, &result->cookie);
result = res2;
result = nis_next_entry (tablename_val, &result->cookie);
if (result == NULL)
{
*errnop = errno;
return NSS_STATUS_TRYAGAIN;
}
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
{
enum nss_status retval= niserr2nss (result->status);

View File

@ -232,6 +232,11 @@ internal_nisplus_getnetent_r (struct netent *network, char *buffer,
}
result = nis_first_entry (tablename_val);
if (result == NULL)
{
*errnop = errno;
return NSS_STATUS_TRYAGAIN;
}
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
{
int retval = niserr2nss (result->status);
@ -249,9 +254,13 @@ internal_nisplus_getnetent_r (struct netent *network, char *buffer,
}
else
{
nis_result *res = nis_next_entry (tablename_val, &result->cookie);
saved_res = result;
result = res;
result = nis_next_entry (tablename_val, &result->cookie);
if (result == NULL)
{
*errnop = errno;
return NSS_STATUS_TRYAGAIN;
}
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
{
int retval = niserr2nss (result->status);

View 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);

View File

@ -229,6 +229,11 @@ internal_nisplus_getrpcent_r (struct rpcent *rpc, 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);
}
@ -236,6 +241,11 @@ internal_nisplus_getrpcent_r (struct rpcent *rpc, 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);

View File

@ -234,6 +234,11 @@ internal_nisplus_getservent_r (struct servent *serv, 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);
}
@ -241,6 +246,11 @@ internal_nisplus_getservent_r (struct servent *serv, 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);

View File

@ -99,6 +99,11 @@ internal_nisplus_getspent_r (struct spwd *sp, char *buffer, size_t buflen,
}
result = nis_first_entry (pwd_tablename_val);
if (result == NULL)
{
*errnop = errno;
return NSS_STATUS_TRYAGAIN;
}
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
return niserr2nss (result->status);
}
@ -106,6 +111,11 @@ internal_nisplus_getspent_r (struct spwd *sp, char *buffer, size_t buflen,
{
saved_res = result;
result = nis_next_entry (pwd_tablename_val, &result->cookie);
if (result == NULL)
{
*errnop = errno;
return NSS_STATUS_TRYAGAIN;
}
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
{
nis_freeresult (saved_res);