Skip to content

Commit

Permalink
rgw: fix crash when listing objects via swift
Browse files Browse the repository at this point in the history
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
  • Loading branch information
yehudasa committed Mar 8, 2017
1 parent c68a298 commit 1047662
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/rgw/rgw_rest_swift.cc
Expand Up @@ -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;
Expand Down

0 comments on commit 1047662

Please sign in to comment.