summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2006-11-03 13:55:37 +0000
committerArthur de Jong <arthur@arthurdejong.org>2006-11-03 13:55:37 +0000
commit245a043d35ef06ccc45f728fa44c1cac7563abcf (patch)
treefa16cd7b93585600c4438548a7f2d72ccec98d9a
parent4dfe010707bb299040170d3dbe3daf0a8cf3268d (diff)
fix bogus reuse of tmpint32, introducing tmp3int32
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@66 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--nslcd-common.h19
-rw-r--r--nss/group.c9
2 files changed, 14 insertions, 14 deletions
diff --git a/nslcd-common.h b/nslcd-common.h
index f4ce301..48ecb64 100644
--- a/nslcd-common.h
+++ b/nslcd-common.h
@@ -136,8 +136,8 @@
/* read an array from a stram and store the length of the
array in num (size for the array is allocated) */
#define READ_STRINGLIST_NUM(fp,arr,num) \
- READ_TYPE(fp,tmpint32,int32_t); \
- (num)=tmpint32; \
+ /* read the number of entries */ \
+ READ_INT32(fp,(num)); \
/* allocate room for *char[num] */ \
tmpint32*=sizeof(char *); \
BUF_CHECK(fp,tmpint32); \
@@ -151,15 +151,15 @@
/* read an array from a stram and store it as a null-terminated
array list (size for the array is allocated) */
#define READ_STRINGLIST_NULLTERM(fp,arr) \
- READ_TYPE(fp,tmpint32,int32_t); \
+ /* read the number of entries */ \
+ READ_TYPE(fp,tmp3int32,int32_t); \
/* allocate room for *char[num+1] */ \
- tmp2int32=(tmpint32+1)*sizeof(char *); \
+ tmp2int32=(tmp3int32+1)*sizeof(char *); \
BUF_CHECK(fp,tmp2int32); \
(arr)=(char **)BUF_CUR; \
- BUF_SKIP(tmpint32); \
+ BUF_SKIP(tmp2int32); \
/* read all entries */ \
- bufptr+=(size_t)tmpint32; \
- for (tmp2int32=0;tmp2int32<tmpint32;tmp2int32++) \
+ for (tmp2int32=0;tmp2int32<tmp3int32;tmp2int32++) \
{ \
READ_STRING_BUF(fp,(arr)[tmp2int32]); \
} \
@@ -176,9 +176,10 @@
/* skip a loop of strings */
#define SKIP_STRINGLIST(fp) \
- READ_TYPE(fp,tmpint32,int32_t); \
+ /* read the number of entries */ \
+ READ_TYPE(fp,tmp3int32,int32_t); \
/* read all entries */ \
- for (tmp2int32=0;tmp2int32<tmpint32;tmp2int32++) \
+ for (tmp2int32=0;tmp2int32<tmp3int32;tmp2int32++) \
{ \
SKIP_STRING(fp); \
}
diff --git a/nss/group.c b/nss/group.c
index df25870..0dcfd38 100644
--- a/nss/group.c
+++ b/nss/group.c
@@ -43,7 +43,7 @@ enum nss_status _nss_ldap_getgrnam_r(const char *name,struct group *result,char
{
FILE *fp;
size_t bufptr=0;
- int32_t tmpint32,tmp2int32;
+ int32_t tmpint32,tmp2int32,tmp3int32;
/* open socket and write request */
OPEN_SOCK(fp);
WRITE_REQUEST(fp,NSLCD_ACTION_GROUP_BYNAME);
@@ -62,7 +62,7 @@ enum nss_status _nss_ldap_getgrgid_r(gid_t gid,struct group *result,char *buffer
{
FILE *fp;
size_t bufptr=0;
- int32_t tmpint32,tmp2int32;
+ int32_t tmpint32,tmp2int32,tmp3int32;
/* open socket and write request */
OPEN_SOCK(fp);
WRITE_REQUEST(fp,NSLCD_ACTION_GROUP_BYGID);
@@ -98,9 +98,8 @@ enum nss_status _nss_ldap_initgroups_dyn(
long int *size,gid_t **groupsp,long int limit,int *errnop)
{
FILE *fp;
- size_t bufptr=0;
int32_t cd;
- int32_t tmpint32,tmp2int32;
+ int32_t tmpint32,tmp2int32,tmp3int32;
gid_t gid;
int num=0;
/* open socket and write the request */
@@ -148,7 +147,7 @@ enum nss_status _nss_ldap_setgrent(void)
enum nss_status _nss_ldap_getgrent_r(struct group *result,char *buffer,size_t buflen,int *errnop)
{
- int32_t tmp2int32;
+ int32_t tmp2int32,tmp3int32;
NSS_GETENT(LDF_GROUP);
}