summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorarao <arao@redhat.com>2015-02-10 11:06:27 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-30 00:33:49 -0700
commit9272b1cf5655fff625b254a1ea952dcefd3c3af1 (patch)
tree26b5b92eefab06382abf929e5182888e452de36e /xlators/storage
parent059e085752d09e841fd685e3ca53aeb2983cd48b (diff)
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 <arao@redhat.com> Reviewed-on: http://review.gluster.org/9619 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/bd/src/bd.c3
1 files changed, 2 insertions, 1 deletions
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,