]> git-server-git.apps.pok.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)
committerPrashant D <pdhange@redhat.com>
Mon, 11 Mar 2019 23:34:10 +0000 (19:34 -0400)
commit9ae76f13df2a8f773944b7ec4d849700228d567f
treec35a4e3e2faf3e741a960e2cba8c510e8a51b9d3
parent48310dabd5ef44dc471facef83a6af8f47704e07
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>
(cherry picked from commit 16ffca6f0a23a96284a7d17c890047121d32058e)
src/common/str_map.cc
src/test/common/test_str_map.cc