Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2017-11-29 16:16:35 +0300
committerIlya Zverev <ilya@zverev.info>2017-11-29 16:17:55 +0300
commit5830f821e25b821e013a125a0980276d27aedf1e (patch)
tree69d95763ecc8c64a1e2eb7ad05b005e9961c025c /indexer/editable_map_object.cpp
parent372e1e7f681360d315e3fd49232319aa3d878ab7 (diff)
[editor] validate name crash fix
Diffstat (limited to 'indexer/editable_map_object.cpp')
-rw-r--r--indexer/editable_map_object.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/indexer/editable_map_object.cpp b/indexer/editable_map_object.cpp
index 82728b3f1d..a80c22deea 100644
--- a/indexer/editable_map_object.cpp
+++ b/indexer/editable_map_object.cpp
@@ -772,7 +772,16 @@ bool EditableMapObject::ValidateName(string const & name)
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> converter;
- std::u32string const u32name = converter.from_bytes(name);
+ std::u32string u32name;
+ try
+ {
+ u32name = converter.from_bytes(name);
+ }
+ catch (std::range_error const &)
+ {
+ // Cannot convert, for ex. it is possible for some emoji.
+ return false;
+ }
std::u32string const excludedSymbols = U"^~§><{}[]*=_±\n\t\r\v\f|√•π÷׶∆°";