1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: fix integer overflow in base32 encoding/decoding

This commit is contained in:
Sébastien Helleu
2025-05-11 15:23:22 +02:00
parent 7f96c31e1b
commit 96dc934241
2 changed files with 5 additions and 2 deletions
+1
View File
@@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
Bug fixes::
* core: fix integer overflow in base32 encoding/decoding
* core: fix integer overflow with decimal numbers in calculation of expression
* core, plugins: fix integer overflow in loops (issue #2178)
* core: fix crash in case of NULL message sent to function gui_chat_printf_y_date_tags (issue #1883)
+4 -2
View File
@@ -3416,7 +3416,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)
@@ -3494,7 +3495,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)