summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-05-14 15:53:18 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-05-15 08:24:21 -0400
commitde2a06183ebea42e27431d5dd94e108ac56e7436 (patch)
tree63da87767e131fc2f364059fbe9dc84ad1a026b4 /src
parentf39b4b2fd57c0ea4cf2f90b511f2cbce37723ef0 (diff)
downloadsssd-de2a06183ebea42e27431d5dd94e108ac56e7436.tar.gz
sssd-de2a06183ebea42e27431d5dd94e108ac56e7436.tar.xz
sssd-de2a06183ebea42e27431d5dd94e108ac56e7436.zip
NSS: keep a pointer to body after body is reallocated
Diffstat (limited to 'src')
-rw-r--r--src/responder/nss/nsssrv_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index f36a9a322..43e82ae3a 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -1919,6 +1919,9 @@ static int fill_grent(struct sss_packet *packet,
num++;
if (gr_mmap_cache) {
+ /* body was reallocated, so fullname might be pointing to
+ * where body used to be, not where it is */
+ to_sized_string(&fullname, (const char *)&body[rzero+STRS_ROFFSET]);
ret = sss_mmap_cache_gr_store(nctx->grp_mc_ctx,
&fullname, &pwfield, gid, memnum,
(char *)&body[rzero] + STRS_ROFFSET +