From bcdb77023e2efbbf06ad576851f0f38a0b8b11ab Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Tue, 18 Jun 2019 16:43:43 +0530 Subject: posix: fix crash in posix_cs_set_state Fixes: bz#1721474 Change-Id: Ic2a53fa3d1e9e23424c6898e0986f80d52c5e3f6 Signed-off-by: Susant Palai --- xlators/storage/posix/src/posix-helpers.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xlators/storage/posix/src/posix-helpers.c') 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)) { -- cgit