From 8f3f0537f2164f563e154c988f59b25d3be70014 Mon Sep 17 00:00:00 2001 From: Christophe Courtaut Date: Fri, 31 May 2013 09:55:27 +0200 Subject: [PATCH] rgw: Do not assum rest connection to be established Added a check to verify that rest connection is correctly initialized, preventing a segmentation fault. Signed-off-by: Christophe Courtaut Reviewed-by: Yehuda Sadeh --- src/rgw/rgw_op.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index a1b46bcefbdcb..5b737fec65387 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -853,6 +853,10 @@ int RGWCreateBucket::verify_permission() template static int forward_request(struct req_state *s, RGWRados *store, bufferlist& in_data, const char *name, T& obj) { + if (!store->rest_conn) { + ldout(s->cct, 0) << "rest connection is invalid" << dendl; + return -EINVAL; + } ldout(s->cct, 0) << "sending create_bucket request to master region" << dendl; bufferlist response; #define MAX_REST_RESPONSE (128 * 1024) // we expect a very small response -- 2.39.5