summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2013-01-14 21:16:56 +0000
committersmatz <smatz@openttd.org>2013-01-14 21:16:56 +0000
commit3a3162865b3174bddcc295fd4bd4eb5398a50ea5 (patch)
treeaa526d8634c2addc8a92e7bfb2a1a81378212993 /src/strings.cpp
parent914bb708ad1558a10112e1001381d90348e82690 (diff)
downloadopenttd-3a3162865b3174bddcc295fd4bd4eb5398a50ea5.tar.xz
(svn r24915) -Fix: Several out-of-bounds reads
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 0fd9b5b41..1e6a0be99 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -2063,12 +2063,12 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
{
if (this->i >= TAB_COUNT) return NULL;
- const char *ret = _langpack_offs[_langtab_start[i] + j];
+ const char *ret = _langpack_offs[_langtab_start[this->i] + this->j];
this->j++;
- while (this->j >= _langtab_num[this->i] && this->i < TAB_COUNT) {
- i++;
- j = 0;
+ while (this->i < TAB_COUNT && this->j >= _langtab_num[this->i]) {
+ this->i++;
+ this->j = 0;
}
return ret;