summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnuradha Talur <atalur@redhat.com>2015-12-08 17:02:23 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-12-21 01:19:19 -0800
commit871bfc1c1418290c30484015f11a8c476489ca2a (patch)
tree11363056cf8167c5989adb76053a565fd46d30c5
parentfbcd691b593cba29ba9c54d3da2c685787f719be (diff)
features/index : Prevent logging due to NULL dict
Backport of http://review.gluster.org/12910 Added a check for non-NULLness of dict before performing dict_foreach_match on it. Change-Id: I77d83559934006425ed33745b8a244b2f5d90cb1 BUG: 1287531 Signed-off-by: Anuradha Talur <atalur@redhat.com> Reviewed-on: http://review.gluster.org/12910 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/12971
-rw-r--r--xlators/features/index/src/index.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c
index 8cdb5feb870..482292a00f9 100644
--- a/xlators/features/index/src/index.c
+++ b/xlators/features/index/src/index.c
@@ -614,11 +614,11 @@ index_find_xattr_type (dict_t *d, char *k, data_t *v)
int idx = -1;
index_priv_t *priv = THIS->private;
- if (is_xattr_in_watchlist (d, k, v,
- priv->dirty_watchlist))
+ if (priv->dirty_watchlist && is_xattr_in_watchlist (d, k, v,
+ priv->dirty_watchlist))
idx = DIRTY;
- else if (is_xattr_in_watchlist (d, k, v,
- priv->pending_watchlist))
+ else if (priv->pending_watchlist && is_xattr_in_watchlist (d, k, v,
+ priv->pending_watchlist))
idx = PENDING;
return idx;