summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-14 19:20:29 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-05-14 19:20:29 +0200
commite69257eaee36b34310cd0f77f9ec56b6d2668bac (patch)
treecb0441c4d8d0a91bd091065c2f97411b1e4a3697
parentd69290219d008ece749e8c43d9a358dc4304c417 (diff)
downloadceph-e69257eaee36b34310cd0f77f9ec56b6d2668bac.tar.gz
rgw/rgw_user.cc: fix possible NULL pointer dereference
CID 1019559 (#1 of 1): Dereference after null check (FORWARD_NULL) var_deref_model: Passing null pointer "usr" to function "RGWUser::get_store()", which dereferences it. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--src/rgw/rgw_user.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc
index b160ff87444..781fce46eda 100644
--- a/src/rgw/rgw_user.cc
+++ b/src/rgw/rgw_user.cc
@@ -992,7 +992,10 @@ int RGWAccessKeyPool::remove(RGWUserAdminOpState& op_state, std::string *err_msg
RGWSubUserPool::RGWSubUserPool(RGWUser *usr)
{
subusers_allowed = (usr != NULL);
- store = usr->get_store();
+ if (usr)
+ store = usr->get_store();
+ else
+ store = NULL;
user = usr;
subuser_map = NULL;
}