summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/dict.c9
-rw-r--r--xlators/cluster/dht/src/dht-common.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index 833f117fc67..fd9dd1cd7c6 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -108,9 +108,12 @@ int32_t
is_data_equal (data_t *one,
data_t *two)
{
- /* LOG-TODO */
- if (!one || !two || !one->data || !two->data)
- return 1;
+ if (!one || !two || !one->data || !two->data) {
+ gf_log_callingfn ("dict", GF_LOG_ERROR,
+ "input arguments are provided "
+ "with value data_t as NULL");
+ return -1;
+ }
if (one == two)
return 1;
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index fb149e7635e..16bb2c9cc7d 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -75,7 +75,7 @@ dht_aggregate (dict_t *this, char *key, data_t *value, void *data)
/* compare user xattrs only */
if (!strncmp (key, "user.", strlen ("user."))) {
ret = dict_lookup (dst, key, &data_pair);
- if (!ret && data) {
+ if (!ret && data_pair && value) {
ret = is_data_equal (data_pair->value, value);
if (!ret)
gf_log ("dht", GF_LOG_WARNING,