From 9272b1cf5655fff625b254a1ea952dcefd3c3af1 Mon Sep 17 00:00:00 2001 From: arao Date: Tue, 10 Feb 2015 11:06:27 +0530 Subject: bd: Fixing dereference after null check(FORWARD_NULL) CID: 1128907 The pointer variable 'bdatt' redirected to a goto label when the value was NULL and in the other condition when it is not NULL , hence the bdatt is again checked for NULL at 'reverse xattr' label. Change-Id: I2289cbf30fde9faf97e6eebd4902953a44049f9e BUG: 789278 Signed-off-by: arao Reviewed-on: http://review.gluster.org/9619 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/storage/bd/src/bd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/storage/bd') diff --git a/xlators/storage/bd/src/bd.c b/xlators/storage/bd/src/bd.c index 456883d9358..6ea18e7787b 100644 --- a/xlators/storage/bd/src/bd.c +++ b/xlators/storage/bd/src/bd.c @@ -1592,7 +1592,8 @@ revert_xattr: /* revert setxattr */ op_ret = dict_get_str (local->dict, BD_XATTR, &bd); GF_FREE (bd); - gf_asprintf (&bd, "%s:%ld", bdatt->type, bdatt->iatt.ia_size); + if (bdatt) + gf_asprintf (&bd, "%s:%ld", bdatt->type, bdatt->iatt.ia_size); if (local->fd) STACK_WIND (frame, bd_trunc_setxattr_setx_cbk, -- cgit