summaryrefslogtreecommitdiff
path: root/server/responder/nss
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-09-08 14:36:11 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-09-08 15:10:49 -0400
commitaef967dc115c64f0288b8ecc3ff1d927aa42af70 (patch)
treefe616b2927b13552453f9c900f30e5d23e096f14 /server/responder/nss
parent8390c75752f96b55185e8be91896574723ffe4c7 (diff)
downloadsssd-aef967dc115c64f0288b8ecc3ff1d927aa42af70.tar.gz
sssd-aef967dc115c64f0288b8ecc3ff1d927aa42af70.tar.bz2
sssd-aef967dc115c64f0288b8ecc3ff1d927aa42af70.zip
Fix two possible uninitialized values
Make counter for used messages explicit.
Diffstat (limited to 'server/responder/nss')
-rw-r--r--server/responder/nss/nsssrv_cmd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/responder/nss/nsssrv_cmd.c b/server/responder/nss/nsssrv_cmd.c
index 88749e9e..abd20a1b 100644
--- a/server/responder/nss/nsssrv_cmd.c
+++ b/server/responder/nss/nsssrv_cmd.c
@@ -1368,7 +1368,7 @@ static int fill_grent(struct sss_packet *packet,
size_t nsize;
size_t delim;
size_t dom_len;
- int i, ret, num, memnum;
+ int i, ret, num, memnum, used;
size_t rzero, rsize;
bool add_domain = dom->fqnames;
const char *domain = dom->name;
@@ -1384,6 +1384,7 @@ static int fill_grent(struct sss_packet *packet,
num = 0;
memnum = 0;
+ used = 0;
/* first 2 fields (len and reserved), filled up later */
ret = sss_packet_grow(packet, 2*sizeof(uint32_t));
@@ -1394,7 +1395,7 @@ static int fill_grent(struct sss_packet *packet,
rzero = 2*sizeof(uint32_t);
rsize = 0;
- for (i = 0; i < *count; i++) {
+ for (i = 0; i < *count; i++, used++) {
msg = msgs[i];
/* new group */
@@ -1607,7 +1608,7 @@ static int fill_grent(struct sss_packet *packet,
}
done:
- *count = i;
+ *count = used;
if (num == 0) {
/* if num is 0 most probably something went wrong,