Skip to content

Commit

Permalink
Fix out-of-bound access in tl_jni_object.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
SpyCheese committed Jan 15, 2025
1 parent ae80abd commit 085e81f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tl/tl/tl_jni_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ static size_t get_utf8_from_utf16_length(const jchar *p, jsize len) {
for (jsize i = 0; i < len; i++) {
unsigned int cur = p[i];
if ((cur & 0xF800) == 0xD800) {
++i;
if (i < len) {
unsigned int next = p[++i];
unsigned int next = p[i];
if ((next & 0xFC00) == 0xDC00 && (cur & 0x400) == 0) {
result += 4;
continue;
Expand Down

0 comments on commit 085e81f

Please sign in to comment.