From 0da374020c17256141fb3971ae792b62097d72df Mon Sep 17 00:00:00 2001 From: Nithya Balachandran Date: Sat, 1 Nov 2014 22:16:32 +0530 Subject: Cluster/DHT : Fixed crash due to null deref A lookup on a linkto file whose trusted.glusterfs.dht.linkto xattr points to a subvol that is not part of the volume can cause the brick process to segfault due to a null dereference. Modified to check for a non-null value before attempting to access the variable. Change-Id: Ie8f9df058f842cfc0c2b52a8f147e557677386fa BUG: 1159571 Signed-off-by: Nithya Balachandran Reviewed-on: http://review.gluster.org/9034 Tested-by: Gluster Build System Reviewed-by: venkatesh somyajulu Reviewed-by: Vijay Bellur --- xlators/cluster/dht/src/dht-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index b01ac0d0738..82b527e9141 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1239,8 +1239,9 @@ dht_lookup_everywhere_done (call_frame_t *frame, xlator_t *this) "subvolume. But linkto points to " "different cached subvolume (%s) " "path %s", - local->skip_unlink.hash_links_to->name, - local->loc.path); + (local->skip_unlink.hash_links_to ? + local->skip_unlink.hash_links_to->name : + " "), local->loc.path); if (local->skip_unlink.opend_fd_count == 0) { -- cgit