mirror of
https://github.com/ceph/ceph
synced 2025-01-03 17:42:36 +00:00
rgw: fix crash when listing objects via swift
Fixes: http://tracker.ceph.com/issues/19249 Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
parent
515db13970
commit
a9ec5e8ce1
@ -283,15 +283,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;
|
||||
|
Loading…
Reference in New Issue
Block a user