diff options
author | Rafał Mikrut <mikrutrafal54@gmail.com> | 2019-11-20 16:22:16 +0100 |
---|---|---|
committer | Rafał Mikrut <mikrutrafal54@gmail.com> | 2019-11-20 16:22:16 +0100 |
commit | 99d8626f4a313471410db421891e90fe768cd929 (patch) | |
tree | b5e855e2c2a8b142af4fc01cfbc0a0257a01ccc5 /core/ustring.cpp | |
parent | 58ca9f17a2650bb381972210d1babbf34ac6819c (diff) | |
download | redot-engine-99d8626f4a313471410db421891e90fe768cd929.tar.gz |
Fix some overflows and unitialized variables
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r-- | core/ustring.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index 0f82ca7e15..25930db201 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -1416,7 +1416,7 @@ bool String::parse_utf8(const char *p_utf8, int p_len) { if (skip == 0) { - uint8_t c = *ptrtmp; + uint8_t c = *ptrtmp >= 0 ? *ptrtmp : uint8_t(256 + *ptrtmp); /* Determine the number of characters in sequence */ if ((c & 0x80) == 0) |