Skip to content

Commit

Permalink
NSS: Fix segfault when mmap cache cannot be initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
sgallagher committed May 24, 2012
1 parent d4080fe commit de00277
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/responder/nss/nsssrv_cmd.c
Expand Up @@ -365,7 +365,7 @@ static int fill_pwent(struct sss_packet *packet,

num++;

if (pw_mmap_cache) {
if (pw_mmap_cache && nctx->pwd_mc_ctx) {
ret = sss_mmap_cache_pw_store(nctx->pwd_mc_ctx,
&fullname, &pwfield,
uid, gid,
Expand Down Expand Up @@ -1918,7 +1918,7 @@ static int fill_grent(struct sss_packet *packet,

num++;

if (gr_mmap_cache) {
if (gr_mmap_cache && nctx->grp_mc_ctx) {
/* 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]);
Expand Down

0 comments on commit de00277

Please sign in to comment.