1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 11:13:12 +02:00

core: fix integer overflow in base32 encoding/decoding

This commit is contained in:
Sébastien Helleu
2025-05-05 20:43:21 +02:00
parent 5b4820ab06
commit ca6035f754
2 changed files with 5 additions and 2 deletions
+1
View File
@@ -20,6 +20,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
- core: add refresh of window title on buffer switch, when option weechat.look.window_title is set
- core: consider all keys are safe in cursor context ([#2244](https://github.com/weechat/weechat/issues/2244))
- core: fix integer overflow with decimal numbers in calculation of expression
- core: fix integer overflow in base32 encoding/decoding
- irc: display nick changes and quit messages when option irc.look.ignore_tag_messages is enabled ([#2241](https://github.com/weechat/weechat/issues/2241))
- perl: fix build when multiplicity is not available ([#2243](https://github.com/weechat/weechat/issues/2243))
+4 -2
View File
@@ -3572,7 +3572,8 @@ int
string_base32_encode (const char *from, int length, char *to)
{
unsigned char base32_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
int count, value, next, bits_left, pad, index;
unsigned int value;
int count, next, bits_left, pad, index;
int length_padding[8] = { 0, 0, 6, 0, 4, 3, 0, 2 };
if (!from || !to)
@@ -3650,7 +3651,8 @@ int
string_base32_decode (const char *from, char *to)
{
const char *ptr_from;
int value, bits_left, count;
int bits_left, count;
unsigned int value;
unsigned char c;
if (!from || !to)