mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix buffer overflow in parseEmoji (#2602)
Co-authored-by: Paweł <zneix@zneix.eu> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
208d017cc3
commit
bc334222c1
|
@ -87,6 +87,7 @@
|
||||||
- Bugfix: Fix directory not opening when clicking "Open AppData Directory" setting button on macOS (#2531, #2537)
|
- Bugfix: Fix directory not opening when clicking "Open AppData Directory" setting button on macOS (#2531, #2537)
|
||||||
- Bugfix: Fix quickswitcher not respecting order of tabs when filtering (#2519, #2561)
|
- Bugfix: Fix quickswitcher not respecting order of tabs when filtering (#2519, #2561)
|
||||||
- Bugfix: Fix GNOME not associating Chatterino's window with its desktop entry (#1863, #2587)
|
- Bugfix: Fix GNOME not associating Chatterino's window with its desktop entry (#1863, #2587)
|
||||||
|
- Bugfix: Fix buffer overflow in emoji parsing. (#2602)
|
||||||
- Dev: Updated minimum required Qt framework version to 5.12. (#2210)
|
- Dev: Updated minimum required Qt framework version to 5.12. (#2210)
|
||||||
- Dev: Migrated `Kraken::getUser` to Helix (#2260)
|
- Dev: Migrated `Kraken::getUser` to Helix (#2260)
|
||||||
- Dev: Migrated `TwitchAccount::(un)followUser` from Kraken to Helix and moved it to `Helix::(un)followUser`. (#2306)
|
- Dev: Migrated `TwitchAccount::(un)followUser` from Kraken to Helix and moved it to `Helix::(un)followUser`. (#2306)
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace {
|
||||||
const rapidjson::Value &unparsedEmoji,
|
const rapidjson::Value &unparsedEmoji,
|
||||||
QString shortCode = QString())
|
QString shortCode = QString())
|
||||||
{
|
{
|
||||||
static uint unicodeBytes[4];
|
std::array<uint32_t, 7> unicodeBytes;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
bool apple;
|
bool apple;
|
||||||
|
@ -91,11 +91,12 @@ namespace {
|
||||||
|
|
||||||
for (const QString &unicodeCharacter : unicodeCharacters)
|
for (const QString &unicodeCharacter : unicodeCharacters)
|
||||||
{
|
{
|
||||||
unicodeBytes[numUnicodeBytes++] =
|
unicodeBytes.at(numUnicodeBytes++) =
|
||||||
QString(unicodeCharacter).toUInt(nullptr, 16);
|
QString(unicodeCharacter).toUInt(nullptr, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
emojiData->value = QString::fromUcs4(unicodeBytes, numUnicodeBytes);
|
emojiData->value =
|
||||||
|
QString::fromUcs4(unicodeBytes.data(), numUnicodeBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
// getToneNames takes a tones and returns their names in the same order
|
// getToneNames takes a tones and returns their names in the same order
|
||||||
|
|
Loading…
Reference in a new issue