]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
ceph_argparse: fix CephBool to CephChoices conversion
authorRicardo Dias <rdias@suse.com>
Mon, 3 Dec 2018 08:05:31 +0000 (08:05 +0000)
committerRicardo Dias <rdias@suse.com>
Mon, 3 Dec 2018 09:54:23 +0000 (09:54 +0000)
commit1a1691d20ca3d0fa3fd9423320c59ffae9fa1ed6
treebc56ebb0872d8049e87841d521b4adcf0c498019
parentb021f2cad5a97a25c7688af86d4bbfee2d3cee8f
ceph_argparse: fix CephBool to CephChoices conversion

Commit 525623b has introduced a regression that makes Ceph clients of
versions prior to Nautilus to receive invalid unicode characters in the
commands list JSON sent by the monitors.

The unicode characters are caused by memory corruption in a dangling
pointer stored by a std::string_view. The dangling pointer belonged to
an std::string object that was already destructed when the
std::string_view is used.
The fix in this PR makes the std::string object to live enough time for
the std::string_view to be used safely.

Signed-off-by: Ricardo Dias <rdias@suse.com>
src/common/cmdparse.cc