From 2f15ffd6b5beef9abd501c594bc3cb38c2683f77 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 2 Jul 2010 04:55:28 +0000 Subject: NULL dereference fixes in code base after running with 'clang' * 212 logical (NULL deref/divide by zero) errors reduced to 28 (27 of them in contrib/ and lex part of codebase, 1 is invalid) * 11 API errors reduced to 0 Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 966 (NULL check for avoiding NULL dereferencing of pointers..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=966 --- xlators/nfs/server/src/nfs3-helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/nfs/server') diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index 95e860162..615c21660 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -394,12 +394,12 @@ nfs3_fill_lookup3res_success (lookup3res *res, nfsstat3 stat, obj.attributes_follow = FALSE; dir.attributes_follow = FALSE; - if (buf) { + if (buf && fh) { nfs3_map_xlid_to_statdev (buf, fh->xlatorid); obj = nfs3_stat_to_post_op_attr (buf); } - if (postparent) { + if (postparent && fh) { nfs3_map_xlid_to_statdev (postparent, fh->xlatorid); dir = nfs3_stat_to_post_op_attr (postparent); } -- cgit