]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/str_map: fix trim() on empty string
authorSage Weil <sage@redhat.com>
Thu, 28 Feb 2019 16:38:54 +0000 (10:38 -0600)
committerSage Weil <sage@redhat.com>
Fri, 1 Mar 2019 05:39:44 +0000 (23:39 -0600)
commit16ffca6f0a23a96284a7d17c890047121d32058e
treefd4c9890c31ff353f43db229c861b74be4f21ceb
parentc1112928b7926fdc0a53d254a5f72055728f3b58
common/str_map: fix trim() on empty string

If was pass an empty string (e.g., with something like
get_str_map("M= T= P=")) we end up with a (size_t)-1 for end.

Fixes: http://tracker.ceph.com/issues/38329
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/str_map.cc
src/test/common/test_str_map.cc