summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-helpers.c
diff options
context:
space:
mode:
authorSusant Palai <spalai@redhat.com>2019-06-18 16:43:43 +0530
committerAmar Tumballi <amarts@redhat.com>2019-06-20 11:52:12 +0000
commitbcdb77023e2efbbf06ad576851f0f38a0b8b11ab (patch)
treedf60e104617b8d04bc233bf1221b8f47738ccb6b /xlators/storage/posix/src/posix-helpers.c
parent1725880dabd2bac8739043c4cb5f9d844557f86e (diff)
posix: fix crash in posix_cs_set_state
Fixes: bz#1721474 Change-Id: Ic2a53fa3d1e9e23424c6898e0986f80d52c5e3f6 Signed-off-by: Susant Palai <spalai@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 686b0becbc2..a0c273fa772 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -3246,6 +3246,11 @@ posix_cs_set_state(xlator_t *this, dict_t **rsp, gf_cs_obj_state state,
char *value = NULL;
size_t xattrsize = 0;
+ if (!rsp) {
+ ret = -1;
+ goto out;
+ }
+
if (!(*rsp)) {
*rsp = dict_new();
if (!(*rsp)) {