diff options
author | smatz <smatz@openttd.org> | 2013-01-14 21:16:56 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2013-01-14 21:16:56 +0000 |
commit | 3a3162865b3174bddcc295fd4bd4eb5398a50ea5 (patch) | |
tree | aa526d8634c2addc8a92e7bfb2a1a81378212993 /src/strings.cpp | |
parent | 914bb708ad1558a10112e1001381d90348e82690 (diff) | |
download | openttd-3a3162865b3174bddcc295fd4bd4eb5398a50ea5.tar.xz |
(svn r24915) -Fix: Several out-of-bounds reads
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 8 |
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; |