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

Compare commits

...

24 Commits

Author SHA1 Message Date
Sébastien Helleu 951c030082 Version 4.6.3 2025-05-11 11:22:11 +02:00
Sébastien Helleu 5def4f72fe core: add API function util_version_number in upgrade guidelines 2025-05-11 10:00:27 +02:00
Sébastien Helleu 3db2f71112 core: fix buffer overflow in function eval_string_range_chars 2025-05-10 21:38:26 +02:00
Sébastien Helleu 09917a807b core: fix buffer overflow in function eval_string_base_encode 2025-05-10 21:31:22 +02:00
Sébastien Helleu 334f88ae2c core: fix buffer overflow in function eval_syntax_highlight_colorize 2025-05-10 21:30:33 +02:00
Sébastien Helleu 2e14645691 core: fix buffer overflow in function util_parse_time 2025-05-08 19:18:59 +02:00
Sébastien Helleu 2c0bbdf9b9 core: fix integer overflow in function util_version_number 2025-05-08 19:18:59 +02:00
Sébastien Helleu 5839df90e7 core: fix memory leak in function util_parse_delay 2025-05-08 18:39:03 +02:00
Sébastien Helleu 6082453002 core: fix integer overflow in base32 encoding/decoding 2025-05-05 21:39:00 +02:00
Sébastien Helleu d0568dce79 core: fix integer overflow with decimal numbers in calculation of expression 2025-05-05 21:38:28 +02:00
Sébastien Helleu 00a873dda0 ci: replace TCL 8.7 by 8.6 in FreeBSD CI 2025-04-21 08:47:37 +02:00
Sébastien Helleu 18e2badfbd Version 4.6.3-dev 2025-04-18 20:43:53 +02:00
Sébastien Helleu 120b048efb Version 4.6.2 2025-04-18 20:39:02 +02:00
Sébastien Helleu 600e438b90 debian: update changelog 2025-04-18 20:03:35 +02:00
Sébastien Helleu bf3a8628ae debian: bump Standards-Version to 4.7.2 2025-04-18 20:01:08 +02:00
Sébastien Helleu 1478ecd77d core: fix write of weechat.log to stdout with weechat-headless --stdout (issue #2247) 2025-04-15 08:16:06 +02:00
Sébastien Helleu 5c9d9bc8fc core: add refresh of window title on buffer switch, when option weechat.look.window_title is set 2025-04-11 19:32:43 +02:00
Sébastien Helleu ff00323363 Version 4.6.2-dev 2025-04-09 13:37:27 +02:00
Sébastien Helleu 1d2e5ce700 Version 4.6.1 2025-04-09 13:33:19 +02:00
Sébastien Helleu 2eebe241ab core: consider all keys are safe in cursor context (issue #2244) 2025-04-04 18:55:46 +02:00
Sébastien Helleu e93cebf02c core: update ChangeLog (issue #2243) 2025-04-02 23:05:16 +02:00
Alvar Penning c3db4946b2 perl: fix build when multiplicity is not available
Building WeeChat 4.6.0 on OpenBSD failed with the following error.

> /usr/ports/pobj/weechat-4.6.0/weechat-4.6.0/src/plugins/perl/weechat-perl.c:356:13: error: expected ')'
>             function) < 0)
>             ^
> /usr/ports/pobj/weechat-4.6.0/weechat-4.6.0/src/plugins/perl/weechat-perl.c:352:9: note: to match this '('
>     if (weechat_asprintf (
>         ^
> /usr/ports/pobj/weechat-4.6.0/weechat-4.6.0/src/plugins/perl/../weechat-plugin.h:1312:31: note: expanded from macro 'weechat_asprintf'
>     (weechat_plugin->asprintf)(__result, __fmt, ##__argz)

On further inspection, the line in question was recently altered in
099e11d7b8, where a comma was forgotten in the
else branch of the MULTIPLICITY ifdef.

After adding the comma, WeeChat builds as usual.
2025-04-02 23:05:14 +02:00
Sébastien Helleu 86d4da2fd1 irc: display nick changes and quit messages when option irc.look.ignore_tag_messages is enabled (closes #2241) 2025-03-28 12:11:29 +01:00
Sébastien Helleu e39ef93903 Version 4.6.1-dev 2025-03-28 12:10:53 +01:00
24 changed files with 123 additions and 77 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ env:
ruby
rubygem-asciidoctor
sudo
tcl87
tcl86
zstd
jobs:
+28
View File
@@ -1,5 +1,33 @@
# WeeChat ChangeLog
## Version 4.6.3 (2025-05-11)
### Fixed
- core: fix integer overflow with decimal numbers in calculation of expression
- core: fix integer overflow in base32 encoding/decoding
- core: fix integer overflow in function util_version_number
- core: fix buffer overflow in function util_parse_time
- core: fix buffer overflow in function eval_syntax_highlight_colorize
- core: fix buffer overflow in function eval_string_base_encode
- core: fix buffer overflow in function eval_string_range_chars
- core: fix memory leak in function util_parse_delay
## Version 4.6.2 (2025-04-18)
### Fixed
- core: fix write of weechat.log to stdout with `weechat-headless --stdout` ([#2247](https://github.com/weechat/weechat/issues/2247))
- core: add refresh of window title on buffer switch, when option weechat.look.window_title is set
## Version 4.6.1 (2025-04-09)
### Fixed
- core: consider all keys are safe in cursor context ([#2244](https://github.com/weechat/weechat/issues/2244))
- 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))
## Version 4.6.0 (2025-03-23)
### Changed
+8
View File
@@ -7,6 +7,14 @@ When upgrading from version X to Y, please read and apply all instructions from
For a list of all changes in each version, please see [CHANGELOG.md](CHANGELOG.md).
## Version 4.6.3
### API function util_version_number
An integer overflow has been fixed in the function
[util_version_number](https://weechat.org/doc/weechat/plugin/#_util_version_number)
which now returns a version up to "127.255.255.255" (0x7FFFFFFF).
## Version 4.6.0
### Relay remote commands
+1 -1
View File
@@ -24,7 +24,7 @@ Build-Depends:
libzstd-dev,
zlib1g-dev,
libcjson-dev
Standards-Version: 4.7.0
Standards-Version: 4.7.2
Homepage: https://weechat.org/
Vcs-Git: https://salsa.debian.org/kolter/weechat.git
Vcs-Browser: https://salsa.debian.org/kolter/weechat
+6
View File
@@ -1,3 +1,9 @@
weechat (4.6.1-1) unstable; urgency=medium
* New upstream release (Closes: #1102450, #1098090)
-- Emmanuel Bouthenot <kolter@debian.org> Wed, 16 Apr 2025 20:31:07 +0000
weechat (4.5.1-1) unstable; urgency=medium
* New upstream release
+1 -1
View File
@@ -24,7 +24,7 @@ Build-Depends:
libzstd-dev,
zlib1g-dev,
libcjson-dev
Standards-Version: 4.7.0
Standards-Version: 4.7.2
Homepage: https://weechat.org/
Vcs-Git: https://salsa.debian.org/kolter/weechat.git
Vcs-Browser: https://salsa.debian.org/kolter/weechat
+2 -2
View File
@@ -15528,8 +15528,8 @@ void weechat_window_set_title (const char *title);
Arguments:
* _title_: new title for terminal (NULL to reset title); string is evaluated,
so variables like `${info:version}` can be used
* _title_: new title for terminal; string is evaluated, so variables like
`${info:version}` can be used
(see <<_string_eval_expression,string_eval_expression>>)
C example:
+3 -3
View File
@@ -15869,9 +15869,9 @@ void weechat_window_set_title (const char *title);
Paramètres :
* _title_ : nouveau titre pour le terminal (NULL pour réinitialiser le titre) ;
la chaîne est évaluée, donc les variables comme `${info:version}` peuvent
être utilisées (voir <<_string_eval_expression,string_eval_expression>>)
* _title_ : nouveau titre pour le terminal ; la chaîne est évaluée, donc les variables
comme `${info:version}` peuvent être utilisées
(voir <<_string_eval_expression,string_eval_expression>>)
Exemple en C :
+2 -2
View File
@@ -16302,8 +16302,8 @@ void weechat_window_set_title (const char *title);
Argomenti:
// TRANSLATION MISSING
* _title_: nuovo titolo per il terminale (NULL per resettarlo);
string is evaluated, so variables like `${info:version}` can be used
* _title_: nuovo titolo per il terminale; string is evaluated, so variables
like `${info:version}` can be used
(see <<_string_eval_expression,string_eval_expression>>)
Esempio in C:
+2 -2
View File
@@ -15797,8 +15797,8 @@ void weechat_window_set_title (const char *title);
引数:
* _title_: 端末の新しいタイトル (タイトルをリセットする場合は NULL);
この文字列は評価されるため、文字列内に `${info:version}` などの変数を含めることが可能です
* _title_: 端末の新しいタイトル; この文字列は評価されるため、文字列内に
`${info:version}` などの変数を含めることが可能です
(<<_string_eval_expression,string_eval_expression>> を参照)
C 言語での使用例:
+3 -1
View File
@@ -15104,7 +15104,9 @@ void weechat_window_set_title (const char *title);
Аргументи:
* _title_: нови наслов за терминал (NULL ако желите да ресетујете наслов); стринг се израчунава, тако да је могуће коришћење променљивих као што је `${info:version}` (погледајте <<_string_eval_expression,string_eval_expression>>)
* _title_: нови наслов за терминал; стринг се израчунава, тако да је могуће
коришћење променљивих као што је `${info:version}`
(погледајте <<_string_eval_expression,string_eval_expression>>)
C пример:
+2 -2
View File
@@ -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;
+1 -5
View File
@@ -498,12 +498,8 @@ config_change_window_title (const void *pointer, void *data,
(void) data;
(void) option;
if (gui_init_ok
|| (CONFIG_STRING(config_look_window_title)
&& CONFIG_STRING(config_look_window_title)[0]))
{
if (gui_init_ok)
gui_window_set_title (CONFIG_STRING(config_look_window_title));
}
}
/*
+10 -2
View File
@@ -300,6 +300,9 @@ eval_string_range_chars (const char *range)
string = NULL;
result = NULL;
if (!range || !range[0])
goto end;
for (i = 0; eval_range_chars[i][0]; i++)
{
if (strcmp (range, eval_range_chars[i][0]) == 0)
@@ -309,11 +312,15 @@ eval_string_range_chars (const char *range)
char1 = utf8_char_int (range);
/* next char must be '-' */
if (!range[0])
goto end;
ptr_char = utf8_next_char (range);
if (!ptr_char || !ptr_char[0] || (ptr_char[0] != '-'))
goto end;
/* next char is the char2 */
if (!range[0])
goto end;
ptr_char = utf8_next_char (ptr_char);
if (!ptr_char || !ptr_char[0])
goto end;
@@ -894,7 +901,7 @@ eval_string_base_encode (const char *text)
ptr_string++;
length = strlen (ptr_string);
result = malloc ((length * 4) + 1);
result = malloc ((length * 4) + 8 + 1);
if (!result)
goto end;
@@ -1572,7 +1579,8 @@ eval_syntax_highlight_colorize (const char *value)
else if (ptr_value[0] == '-')
color--;
}
ptr_value++;
if (ptr_value[0])
ptr_value++;
if (config_num_eval_syntax_colors > 0)
{
string_dyn_concat (
+12 -11
View File
@@ -70,21 +70,22 @@ log_open (const char *filename, const char *mode)
{
weechat_log_file = stdout;
}
else if (filename)
{
weechat_log_filename = strdup (filename);
}
else
{
string_asprintf (&weechat_log_filename,
"%s/%s", weechat_state_dir, WEECHAT_LOG_NAME);
if (filename)
{
weechat_log_filename = strdup (filename);
}
else
{
string_asprintf (&weechat_log_filename,
"%s/%s", weechat_state_dir, WEECHAT_LOG_NAME);
}
if (!weechat_log_filename)
return 0;
weechat_log_file = fopen (weechat_log_filename, mode);
}
if (!weechat_log_filename)
return 0;
weechat_log_file = fopen (weechat_log_filename, mode);
if (!weechat_log_file)
{
if (weechat_log_filename)
+4 -2
View File
@@ -3570,7 +3570,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)
@@ -3648,7 +3649,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)
+8 -5
View File
@@ -285,7 +285,8 @@ util_strftimeval (char *string, int max, const char *format, struct timeval *tv)
int
util_parse_time (const char *datetime, struct timeval *tv)
{
char *string, *pos, *pos2, str_usec[16], *error, str_date[128];
char *string, *pos, *pos2, str_usec[16], *error;
char str_date[128], str_date2[256];
struct tm tm_date, tm_date_gm, tm_date_local, *local_time;
time_t time_now, time_gm, time_local;
long long value;
@@ -445,10 +446,10 @@ util_parse_time (const char *datetime, struct timeval *tv)
local_time = localtime (&time_now);
strftime (str_date, sizeof (str_date),
"%Y-%m-%dT", local_time);
strcat (str_date, string);
snprintf (str_date2, sizeof (str_date2), "%s%s", str_date, string);
/* initialize structure, because strptime does not do it */
memset (&tm_date, 0, sizeof (struct tm));
pos = strptime (str_date, "%Y-%m-%dT%H:%M:%S", &tm_date);
pos = strptime (str_date2, "%Y-%m-%dT%H:%M:%S", &tm_date);
if (pos)
{
if (use_local_time)
@@ -571,7 +572,6 @@ util_parse_delay (const char *string_delay, unsigned long long default_factor,
if ((pos > string_delay) && pos[0])
{
str_number = string_strndup (string_delay, pos - string_delay);
if (strcmp (pos, "us") == 0)
factor = 1ULL;
else if (strcmp (pos, "ms") == 0)
@@ -584,6 +584,7 @@ util_parse_delay (const char *string_delay, unsigned long long default_factor,
factor = 1000ULL * 1000ULL * 60ULL * 60ULL;
else
return 0;
str_number = string_strndup (string_delay, pos - string_delay);
}
else
{
@@ -670,7 +671,9 @@ util_version_number (const char *version)
{
if (number < 0)
number = 0;
else if (number > 0xFF)
else if ((i == 0) && (number > 0x7F))
number = 0x7F;
else if ((i > 0) && (number > 0xFF))
number = 0xFF;
version_int[i] = number;
}
+1 -13
View File
@@ -231,12 +231,7 @@ gui_main_init (void)
gui_term_cols, gui_term_lines, 100, 100))
{
gui_current_window = gui_windows;
if (CONFIG_STRING(config_look_window_title)
&& CONFIG_STRING(config_look_window_title)[0])
{
gui_window_set_title (CONFIG_STRING(config_look_window_title));
}
gui_window_set_title (CONFIG_STRING(config_look_window_title));
}
/* switch to buffer */
@@ -526,13 +521,6 @@ gui_main_end (int clean_exit)
/* delete global history */
gui_history_global_free ();
/* reset title */
if (CONFIG_STRING(config_look_window_title)
&& CONFIG_STRING(config_look_window_title)[0])
{
gui_window_set_title (NULL);
}
/* end color */
gui_color_end ();
+8 -8
View File
@@ -2479,13 +2479,11 @@ gui_window_refresh_screen (int full_refresh)
refresh ();
gui_window_read_terminal_size ();
refresh ();
gui_window_set_title (
(CONFIG_STRING(config_look_window_title)
&& CONFIG_STRING(config_look_window_title)[0]) ?
CONFIG_STRING(config_look_window_title) : NULL);
}
gui_window_refresh_windows ();
gui_window_set_title (CONFIG_STRING(config_look_window_title));
}
/*
@@ -2573,15 +2571,17 @@ gui_window_set_title (const char *title)
{
char *new_title, *envterm, *envshell, *shell, *shellname;
envterm = getenv ("TERM");
if (!envterm)
if (!title || !title[0])
return;
new_title = (title && title[0]) ?
eval_expression (title, NULL, NULL, NULL) : NULL;
new_title = eval_expression (title, NULL, NULL, NULL);
if (!new_title)
return;
envterm = getenv ("TERM");
if (!envterm)
return;
if (strcmp (envterm, "sun-cmd") == 0)
{
printf ("\033]l%s\033\\", new_title);
+10 -10
View File
@@ -1213,12 +1213,12 @@ gui_key_set_score (struct t_gui_key *key)
}
/*
* Checks if a key is safe or not: a safe key begins always with the "meta" or
* "ctrl" code (except "@" allowed in cursor/mouse contexts).
* Checks if a key is safe or not: a safe key should begin with the "meta" or
* "ctrl" code (there are exceptions).
*
* Returns:
* 1: key is safe
* 0: key is NOT safe
* 1: key is safe for the given context
* 0: key is NOT safe for the given context
*/
int
@@ -1229,13 +1229,13 @@ gui_key_is_safe (int context, const char *key)
if (!key || !key[0])
return 0;
/* "@" is allowed at beginning for cursor/mouse contexts */
if ((key[0] == '@')
&& ((context == GUI_KEY_CONTEXT_CURSOR)
|| (context == GUI_KEY_CONTEXT_MOUSE)))
{
/* all keys are safe in cursor mode */
if (context == GUI_KEY_CONTEXT_CURSOR)
return 1;
/* "@" is allowed at beginning for mouse context */
if ((key[0] == '@') && (context == GUI_KEY_CONTEXT_MOUSE))
return 1;
}
if (strncmp (key, "comma", 5) == 0)
return 0;
+2 -3
View File
@@ -2393,8 +2393,7 @@ IRC_PROTOCOL_CALLBACK(nick)
}
else
{
if (!irc_ignore_check (ctxt->server, ptr_channel->name,
ctxt->nick, ctxt->host))
if (!ctxt->ignore_remove)
{
ptr_nick_speaking = ((weechat_config_boolean (irc_config_look_smart_filter))
&& (weechat_config_boolean (irc_config_look_smart_filter_nick))) ?
@@ -3401,7 +3400,7 @@ IRC_PROTOCOL_CALLBACK(quit)
if (ptr_nick
|| (irc_server_strcasecmp (ctxt->server, ptr_channel->name, ctxt->nick) == 0))
{
if (!irc_ignore_check (ctxt->server, ptr_channel->name, ctxt->nick, ctxt->host))
if (!ctxt->ignore_remove)
{
/* display quit message */
ptr_nick_speaking = NULL;
+1 -1
View File
@@ -352,7 +352,7 @@ weechat_perl_exec (struct t_plugin_script *script,
if (weechat_asprintf (
&func,
"%s::%s",
(char *) ((script->interpreter) ? script->interpreter : perl_main)
(char *) ((script->interpreter) ? script->interpreter : perl_main),
function) < 0)
{
return NULL;
+5
View File
@@ -537,4 +537,9 @@ TEST(CoreUtil, VersionNumber)
LONGS_EQUAL(0x01010100, util_version_number ("1.1.1"));
LONGS_EQUAL(0x01010200, util_version_number ("1.1.2"));
LONGS_EQUAL(0x01020304, util_version_number ("1.2.3.4"));
LONGS_EQUAL(0x7EFFFFFF, util_version_number ("126.255.255.255"));
LONGS_EQUAL(0x7FFFFFFF, util_version_number ("127.255.255.255"));
LONGS_EQUAL(0x7FFFFFFF, util_version_number ("128.255.255.255"));
LONGS_EQUAL(0x7FFFFFFF, util_version_number ("255.255.255.255"));
LONGS_EQUAL(0x7FFFFFFF, util_version_number ("999999999.999999999.999999999.999999999"));;
}
+2 -2
View File
@@ -39,8 +39,8 @@
# devel-number the devel version as hex number ("0x04010000" for "4.1.0-dev")
#
weechat_stable="4.6.0"
weechat_devel="4.6.0"
weechat_stable="4.6.3"
weechat_devel="4.6.3"
stable_major=$(echo "${weechat_stable}" | cut -d"." -f1)
stable_minor=$(echo "${weechat_stable}" | cut -d"." -f2)