From 7f96c31e1bb02f817f3ef06214546b820d19a4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 11 May 2025 14:48:17 +0200 Subject: [PATCH] core: fix integer overflow with decimal numbers in calculation of expression --- ChangeLog.adoc | 1 + src/core/wee-calc.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index dc518e059..ed02aeede 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] Bug fixes:: + * 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) diff --git a/src/core/wee-calc.c b/src/core/wee-calc.c index 657497107..3a15bf85c 100644 --- a/src/core/wee-calc.c +++ b/src/core/wee-calc.c @@ -336,9 +336,9 @@ calc_expression (const char *expr) struct t_arraylist *list_values, *list_ops; const char *ptr_expr, *ptr_expr2; char str_result[64], *ptr_operator, *operator; - int index_op, decimals; + int index_op; enum t_calc_symbol last_symbol; - double value, factor, *ptr_value; + double value, factor, decimals, *ptr_value; list_values = NULL; list_ops = NULL;