summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-10-09 16:26:22 -0700
committerAsheem Mamoowala <asheem.mamoowala@mapbox.com>2017-10-12 12:28:04 -0700
commit11fc853b7c0acbbc1c8930e580bd6171227b1af6 (patch)
treebccb2f67989a5bd2209fc7e539d61e21720461d0
parent78ea88d757ecf3a0a75b786ae343d746617ba46b (diff)
downloadqtlocation-mapboxgl-upstream/cherry-pick-10175.tar.gz
[core] Fix out-of-bounds array accessupstream/cherry-pick-10175
-rw-r--r--src/mbgl/util/i18n.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mbgl/util/i18n.cpp b/src/mbgl/util/i18n.cpp
index 16f1d669f3..3e3a68e248 100644
--- a/src/mbgl/util/i18n.cpp
+++ b/src/mbgl/util/i18n.cpp
@@ -554,7 +554,7 @@ std::u16string verticalizePunctuation(const std::u16string& input) {
std::u16string output;
for (size_t i = 0; i < input.size(); i++) {
- char16_t nextCharCode = i < input.size() ? input[i + 1] : 0;
+ char16_t nextCharCode = i < input.size() - 1 ? input[i + 1] : 0;
char16_t prevCharCode = i ? input[i - 1] : 0;
bool canReplacePunctuation =