Skip to content

Commit

Permalink
rgw: fix crash when listing objects via swift
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/19249

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit a9ec5e8)

Conflicts:
        src/rgw/rgw_rest_swift.cc (kraken does not have
           5cf5ab4, so retain kraken
           rgw_obj_key& type)
  • Loading branch information
yehudasa authored and smithfarm committed Apr 15, 2017
1 parent fc5c4cd commit a7c38a1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/rgw/rgw_rest_swift.cc
Expand Up @@ -282,15 +282,18 @@ void RGWListBucket_ObjStore_SWIFT::send_response()
while (iter != objs.end() || pref_iter != common_prefixes.end()) {
bool do_pref = false;
bool do_objs = false;
rgw_obj_key& key = iter->key;
rgw_obj_key& key;
if (iter != objs.end()) {
key = iter->key;
}
if (pref_iter == common_prefixes.end())
do_objs = true;
else if (iter == objs.end())
do_pref = true;
else if (key.name.compare(pref_iter->first) == 0) {
else if (!key.empty() && key.name.compare(pref_iter->first) == 0) {
do_objs = true;
++pref_iter;
} else if (key.name.compare(pref_iter->first) <= 0)
} else if (!key.empty() && key.name.compare(pref_iter->first) <= 0)
do_objs = true;
else
do_pref = true;
Expand Down

0 comments on commit a7c38a1

Please sign in to comment.