1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-22 10:56:38 +02:00

Compare commits

..

22 Commits

Author SHA1 Message Date
Sébastien Helleu 0ba30fc217 core: use function util_parse_longlong to parse date in command /print 2026-06-20 11:54:32 +02:00
Sébastien Helleu 9cf398afa1 core: use function util_parse_longlong to parse time in function hdata_set 2026-06-20 11:54:32 +02:00
Sébastien Helleu c150f67cf9 xfer: use util functions to parse integers 2026-06-20 11:33:47 +02:00
Sébastien Helleu 3df0d2d4d3 trigger: use util functions to parse integers 2026-06-20 11:32:44 +02:00
Sébastien Helleu 4d2d93a694 script: use util functions to parse integers 2026-06-20 11:31:33 +02:00
Sébastien Helleu cb0a9a3c42 relay: use util functions to parse integers 2026-06-20 11:27:42 +02:00
Sébastien Helleu 15f0cef09e api: use util functions to parse integers 2026-06-20 11:16:19 +02:00
Sébastien Helleu 49c4c2267a python: use function util_parse_int in API function hook_signal_send 2026-06-20 11:12:54 +02:00
Sébastien Helleu b6f4343d78 javascript: use function util_parse_int in API function hook_signal_send 2026-06-20 11:12:13 +02:00
Sébastien Helleu 0ae7ce165e irc: use util functions to parse integers 2026-06-20 11:09:20 +02:00
Sébastien Helleu 8d69194398 fset: use util functions to parse integers 2026-06-20 10:41:42 +02:00
Sébastien Helleu 054b7ff600 exec: use util functions to parse integers 2026-06-20 10:41:42 +02:00
Sébastien Helleu 0ade9757eb buflist: use util functions to parse integers 2026-06-20 10:41:42 +02:00
Sébastien Helleu 64c0c34735 core: use util functions to parse integers in buffer functions 2026-06-20 10:41:42 +02:00
Sébastien Helleu 6d89ea1324 core: use util functions to parse integers in window functions 2026-06-20 09:51:33 +02:00
Sébastien Helleu bbab9eceb9 core: use util functions to parse integers in nicklist functions 2026-06-20 09:51:33 +02:00
Sébastien Helleu 958c1b84fa core: use util functions to parse integers in function gui_line_hook_update 2026-06-20 09:51:33 +02:00
Sébastien Helleu c545cf75f3 core: use function util_parse_int in function gui_key_grab_init 2026-06-20 09:50:55 +02:00
Sébastien Helleu f34cb85ca3 core: use function util_parse_int in function gui_hotlist_clear_level_string 2026-06-20 09:50:55 +02:00
Sébastien Helleu bed3467efb core: use function util_parse_int in function gui_focus_info_hashtable_gui_focus_info_cb 2026-06-20 09:21:24 +02:00
Sébastien Helleu d5bb81fd2b core: use function util_parse_int in color functions 2026-06-20 09:21:22 +02:00
Sébastien Helleu c03bb825c4 core: use function util_parse_longlong in function gui_chat_hsignal_quote_line_cb 2026-06-20 09:18:36 +02:00
13 changed files with 51 additions and 74 deletions
-2
View File
@@ -28,10 +28,8 @@ SPDX-License-Identifier: GPL-3.0-or-later
- api: fix infinite loop in function string_replace when the search string is empty
- irc: fix tag in message with list of names when joining a channel
- fset: remove error displayed in core buffer when clicking with the mouse below the last option displayed
- guile, lua, perl, python, ruby, tcl: fix conversion of dates in the API functions
- irc: limit size of data received from the server to prevent memory exhaustion
- irc: fix out-of-bounds read on incoming DCC command with a quoted filename ending the message ([#2322](https://github.com/weechat/weechat/issues/2322))
- irc: fix conversion of dates in received messages
- relay: limit size of decompressed websocket frame with permessage-deflate to prevent memory exhaustion ([GHSA-v2v4-45wm-5cr3](https://github.com/weechat/weechat/security/advisories/GHSA-v2v4-45wm-5cr3), [CVE-2026-53524](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53524))
- relay: limit size of received websocket frame and HTTP body to prevent memory exhaustion
- relay: limit size of partial message received while reading an HTTP request to prevent memory exhaustion
-7
View File
@@ -1034,13 +1034,6 @@ Path parameters:
confused with the buffer number, which is different)
* `buffer_name` (string, **required**): buffer name
Query parameters:
* `colors` (string, optional, default: `ansi`): how to return strings with color codes:
** `ansi`: return ANSI color codes
** `weechat`: return WeeChat internal color codes
** `strip`: strip colors
Request example: get nicks of a buffer:
[source,shell]
-8
View File
@@ -1046,14 +1046,6 @@ Paramètres de chemin :
confondre avec le numéro du tampon, qui est différent)
* `buffer_name` (chaîne, **obligatoire**) : nom du tampon
Paramètres de requête :
* `colors` (chaîne, facultatif, par défaut : `ansi`) : comment les chaînes avec
des couleurs sont retournées :
** `ansi` : retourner les codes couleur ANSI
** `weechat` : retourner les codes couleur internes WeeChat
** `strip` : supprimer les couleurs
Exemple de requête : obtenir les pseudos d'un tampon :
[source,shell]
+1 -8
View File
@@ -1030,19 +1030,12 @@ GET /api/buffers/{id_бафера}/nicks
GET /api/buffers/{име_бафера}/nicks
----
Параметри путање:
Параметри упита:
* `id_бафера` (цео број, **обавезно**): јединствени идентификатор бафера (не треба
да се помеша са бројем бафера, то је нешто друго)
* `име_бафера` (стринг, **обавезно**): име бафера
Параметри упита:
* `colors` (стринг, није обавезно, подразумевано: `ansi`): како се враћају стрингови са кодовима боје:
** `ansi`: враћају се ANSI кодови боје
** `weechat`: враћају се WeeChat интерни кодови боје
** `strip`: уклањају се боје
Пример захтева: врати надимке бафера:
[source,shell]
+1 -1
View File
@@ -7401,7 +7401,7 @@ command_upgrade_display (struct t_gui_buffer *buffer,
str_first_start[0] = '\0';
str_last_start[0] = '\0';
weechat_last_start_time = weechat_current_start_timeval.tv_sec;
weechat_last_start_time = (time_t)weechat_current_start_timeval.tv_sec;
if (translated_string)
{
+5 -5
View File
@@ -2096,7 +2096,7 @@ weechat_guile_api_print_date_tags (SCM buffer, SCM date, SCM tags, SCM message)
plugin_script_api_printf_date_tags (weechat_guile_plugin,
guile_current_script,
API_STR2PTR(API_SCM_TO_STRING(buffer)),
(time_t)scm_to_long_long (date),
(time_t)scm_to_long (date),
API_SCM_TO_STRING(tags),
"%s", API_SCM_TO_STRING(message));
@@ -2117,7 +2117,7 @@ weechat_guile_api_print_datetime_tags (SCM buffer, SCM date, SCM date_usec,
weechat_guile_plugin,
guile_current_script,
API_STR2PTR(API_SCM_TO_STRING(buffer)),
(time_t)scm_to_long_long (date),
(time_t)scm_to_long (date),
scm_to_int (date_usec),
API_SCM_TO_STRING(tags),
"%s", API_SCM_TO_STRING(message));
@@ -2156,7 +2156,7 @@ weechat_guile_api_print_y_date_tags (SCM buffer, SCM y, SCM date, SCM tags,
guile_current_script,
API_STR2PTR(API_SCM_TO_STRING(buffer)),
scm_to_int (y),
(time_t)scm_to_long_long (date),
(time_t)scm_to_long (date),
API_SCM_TO_STRING(tags),
"%s", API_SCM_TO_STRING(message));
@@ -2178,7 +2178,7 @@ weechat_guile_api_print_y_datetime_tags (SCM buffer, SCM y, SCM date,
guile_current_script,
API_STR2PTR(API_SCM_TO_STRING(buffer)),
scm_to_int (y),
(time_t)scm_to_long_long (date),
(time_t)scm_to_long (date),
scm_to_int (date_usec),
API_SCM_TO_STRING(tags),
"%s", API_SCM_TO_STRING(message));
@@ -4748,7 +4748,7 @@ weechat_guile_api_infolist_new_var_time (SCM item, SCM name, SCM value)
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(API_SCM_TO_STRING(item)),
API_SCM_TO_STRING(name),
(time_t)scm_to_long_long (value)));
(time_t)scm_to_long (value)));
API_RETURN_STRING(result);
}
+8 -7
View File
@@ -4710,7 +4710,7 @@ IRC_PROTOCOL_CALLBACK(317)
min = ((idle_time % (60 * 60 * 24)) % (60 * 60)) / 60;
sec = ((idle_time % (60 * 60 * 24)) % (60 * 60)) % 60;
datetime = (time_t)(atoll (ctxt->params[3]));
datetime = (time_t)(atol (ctxt->params[3]));
ptr_buffer = irc_msgbuffer_get_target_buffer (ctxt->server, ctxt->params[1],
ctxt->command, "whois", NULL);
@@ -5066,7 +5066,7 @@ IRC_PROTOCOL_CALLBACK(329)
ptr_channel = irc_channel_search (ctxt->server, ctxt->params[1]);
datetime = (time_t)(atoll (ctxt->params[2]));
datetime = (time_t)(atol (ctxt->params[2]));
if (ptr_channel)
{
@@ -5290,7 +5290,8 @@ IRC_PROTOCOL_CALLBACK(333)
ptr_channel = irc_channel_search (ctxt->server, ctxt->params[1]);
ptr_nick = (ptr_channel) ?
irc_nick_search (ctxt->server, ptr_channel, topic_nick) : NULL;
datetime = (time_t)(atoll ((ctxt->num_params > 3) ? ctxt->params[3] : ctxt->params[2]));
datetime = (ctxt->num_params > 3) ?
(time_t)(atol (ctxt->params[3])) : (time_t)(atol (ctxt->params[2]));
if (!topic_nick && (datetime == 0))
return WEECHAT_RC_OK;
@@ -5597,7 +5598,7 @@ IRC_PROTOCOL_CALLBACK(346)
irc_message_get_address_from_host (ctxt->params[3]));
if (ctxt->num_params >= 5)
{
datetime = (time_t)(atoll (ctxt->params[4]));
datetime = (time_t)(atol (ctxt->params[4]));
if (ptr_modelist)
irc_modelist_item_new (ptr_modelist, ctxt->params[2], ctxt->params[3], datetime);
weechat_printf_datetime_tags (
@@ -5776,7 +5777,7 @@ IRC_PROTOCOL_CALLBACK(348)
irc_message_get_address_from_host (ctxt->params[3]));
if (ctxt->num_params >= 5)
{
datetime = (time_t)(atoll (ctxt->params[4]));
datetime = (time_t)(atol (ctxt->params[4]));
if (ptr_modelist)
irc_modelist_item_new (ptr_modelist, ctxt->params[2], ctxt->params[3], datetime);
weechat_printf_datetime_tags (
@@ -6806,7 +6807,7 @@ IRC_PROTOCOL_CALLBACK(367)
irc_message_get_address_from_host (ctxt->params[3]));
if (ctxt->num_params >= 5)
{
datetime = (time_t)(atoll (ctxt->params[4]));
datetime = (time_t)(atol (ctxt->params[4]));
if (ptr_modelist)
{
irc_modelist_item_new (ptr_modelist, ctxt->params[2], ctxt->params[3],
@@ -7381,7 +7382,7 @@ IRC_PROTOCOL_CALLBACK(728)
irc_message_get_address_from_host (ctxt->params[4]));
if (ctxt->num_params >= 6)
{
datetime = (time_t)(atoll (ctxt->params[5]));
datetime = (time_t)(atol (ctxt->params[5]));
if (ptr_modelist)
{
irc_modelist_item_new (ptr_modelist, ctxt->params[3], ctxt->params[4],
+5 -5
View File
@@ -2173,7 +2173,7 @@ API_FUNC(print)
API_FUNC(print_date_tags)
{
const char *buffer, *tags, *message;
long long date;
long date;
API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR);
if (lua_gettop (L) < 4)
@@ -2197,7 +2197,7 @@ API_FUNC(print_date_tags)
API_FUNC(print_datetime_tags)
{
const char *buffer, *tags, *message;
long long date;
long date;
int date_usec;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
@@ -2247,7 +2247,7 @@ API_FUNC(print_y_date_tags)
{
const char *buffer, *tags, *message;
int y;
long long date;
long date;
API_INIT_FUNC(1, "print_y_date_tags", API_RETURN_ERROR);
if (lua_gettop (L) < 5)
@@ -2274,7 +2274,7 @@ API_FUNC(print_y_datetime_tags)
{
const char *buffer, *tags, *message;
int y, date_usec;
long long date;
long date;
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (lua_gettop (L) < 6)
@@ -5008,7 +5008,7 @@ API_FUNC(infolist_new_var_time)
{
const char *item, *name;
const char *result;
long long value;
long value;
API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY);
if (lua_gettop (L) < 3)
+5 -5
View File
@@ -2106,7 +2106,7 @@ API_FUNC(print_date_tags)
plugin_script_api_printf_date_tags (weechat_perl_plugin,
perl_current_script,
API_STR2PTR(buffer),
(time_t)(SvNV (ST (1))), /* date */
(time_t)(SvIV (ST (1))), /* date */
tags,
"%s", message);
@@ -2129,7 +2129,7 @@ API_FUNC(print_datetime_tags)
plugin_script_api_printf_datetime_tags (weechat_perl_plugin,
perl_current_script,
API_STR2PTR(buffer),
(time_t)(SvNV (ST (1))), /* date */
(time_t)(SvIV (ST (1))), /* date */
SvIV (ST (2)), /* date_usec */
tags,
"%s", message);
@@ -2175,7 +2175,7 @@ API_FUNC(print_y_date_tags)
perl_current_script,
API_STR2PTR(buffer),
SvIV (ST (1)), /* y */
(time_t)(SvNV (ST (2))), /* date */
(time_t)(SvIV (ST (2))), /* date */
tags,
"%s", message);
@@ -2199,7 +2199,7 @@ API_FUNC(print_y_datetime_tags)
perl_current_script,
API_STR2PTR(buffer),
SvIV (ST (1)), /* y */
(time_t)(SvNV (ST (2))), /* date */
(time_t)(SvIV (ST (2))), /* date */
SvIV (ST (3)), /* date_usec */
tags,
"%s", message);
@@ -4940,7 +4940,7 @@ API_FUNC(infolist_new_var_time)
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(item),
name,
(time_t)(SvNV (ST (2))))); /* value */
(time_t)(SvIV (ST (2))))); /* value */
API_RETURN_STRING(result);
}
+1 -1
View File
@@ -1042,7 +1042,7 @@ plugin_api_info_uptime_current_cb (const void *pointer, void *data,
(void) info_name;
return plugin_api_info_build_uptime (
weechat_current_start_timeval.tv_sec,
(time_t)weechat_current_start_timeval.tv_sec,
arguments);
}
+10 -10
View File
@@ -2093,14 +2093,14 @@ API_FUNC(prnt)
API_FUNC(prnt_date_tags)
{
char *buffer, *tags, *message;
long long date;
long date;
API_INIT_FUNC(1, "prnt_date_tags", API_RETURN_ERROR);
buffer = NULL;
date = 0;
tags = NULL;
message = NULL;
if (!PyArg_ParseTuple (args, "sLss", &buffer, &date, &tags, &message))
if (!PyArg_ParseTuple (args, "slss", &buffer, &date, &tags, &message))
API_WRONG_ARGS(API_RETURN_ERROR);
plugin_script_api_printf_date_tags (weechat_python_plugin,
@@ -2116,7 +2116,7 @@ API_FUNC(prnt_date_tags)
API_FUNC(prnt_datetime_tags)
{
char *buffer, *tags, *message;
long long date;
long date;
int date_usec;
API_INIT_FUNC(1, "prnt_datetime_tags", API_RETURN_ERROR);
@@ -2125,7 +2125,7 @@ API_FUNC(prnt_datetime_tags)
date_usec = 0;
tags = NULL;
message = NULL;
if (!PyArg_ParseTuple (args, "sLiss", &buffer, &date, &date_usec, &tags,
if (!PyArg_ParseTuple (args, "sliss", &buffer, &date, &date_usec, &tags,
&message))
API_WRONG_ARGS(API_RETURN_ERROR);
@@ -2165,7 +2165,7 @@ API_FUNC(prnt_y_date_tags)
{
char *buffer, *tags, *message;
int y;
long long date;
long date;
API_INIT_FUNC(1, "prnt_y_date_tags", API_RETURN_ERROR);
buffer = NULL;
@@ -2173,7 +2173,7 @@ API_FUNC(prnt_y_date_tags)
date = 0;
tags = NULL;
message = NULL;
if (!PyArg_ParseTuple (args, "siLss", &buffer, &y, &date, &tags, &message))
if (!PyArg_ParseTuple (args, "silss", &buffer, &y, &date, &tags, &message))
API_WRONG_ARGS(API_RETURN_ERROR);
plugin_script_api_printf_y_date_tags (weechat_python_plugin,
@@ -2191,7 +2191,7 @@ API_FUNC(prnt_y_datetime_tags)
{
char *buffer, *tags, *message;
int y;
long long date;
long date;
int date_usec;
API_INIT_FUNC(1, "prnt_y_datetime_tags", API_RETURN_ERROR);
@@ -2201,7 +2201,7 @@ API_FUNC(prnt_y_datetime_tags)
date_usec = 0;
tags = NULL;
message = NULL;
if (!PyArg_ParseTuple (args, "siLiss", &buffer, &y, &date, &date_usec,
if (!PyArg_ParseTuple (args, "siliss", &buffer, &y, &date, &date_usec,
&tags, &message))
API_WRONG_ARGS(API_RETURN_ERROR);
@@ -4904,13 +4904,13 @@ API_FUNC(infolist_new_var_time)
{
char *item, *name;
const char *result;
long long value;
long value;
API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY);
item = NULL;
name = NULL;
value = 0;
if (!PyArg_ParseTuple (args, "ssL", &item, &name, &value))
if (!PyArg_ParseTuple (args, "ssl", &item, &name, &value))
API_WRONG_ARGS(API_RETURN_EMPTY);
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(item),
+5 -5
View File
@@ -2604,7 +2604,7 @@ weechat_ruby_api_print_date_tags (VALUE class, VALUE buffer, VALUE date,
Check_Type (message, T_STRING);
c_buffer = StringValuePtr (buffer);
c_date = NUM2ULL (date);
c_date = NUM2ULONG (date);
c_tags = StringValuePtr (tags);
c_message = StringValuePtr (message);
@@ -2639,7 +2639,7 @@ weechat_ruby_api_print_datetime_tags (VALUE class, VALUE buffer, VALUE date,
Check_Type (message, T_STRING);
c_buffer = StringValuePtr (buffer);
c_date = NUM2ULL (date);
c_date = NUM2ULONG (date);
c_date_usec = NUM2INT (date_usec);
c_tags = StringValuePtr (tags);
c_message = StringValuePtr (message);
@@ -2703,7 +2703,7 @@ weechat_ruby_api_print_y_date_tags (VALUE class, VALUE buffer, VALUE y,
c_buffer = StringValuePtr (buffer);
c_y = NUM2INT (y);
c_date = NUM2ULL (date);
c_date = NUM2ULONG (date);
c_tags = StringValuePtr (tags);
c_message = StringValuePtr (message);
@@ -2741,7 +2741,7 @@ weechat_ruby_api_print_y_datetime_tags (VALUE class, VALUE buffer, VALUE y,
c_buffer = StringValuePtr (buffer);
c_y = NUM2INT (y);
c_date = NUM2ULL (date);
c_date = NUM2ULONG (date);
c_date_usec = NUM2INT (date_usec);
c_tags = StringValuePtr (tags);
c_message = StringValuePtr (message);
@@ -6040,7 +6040,7 @@ weechat_ruby_api_infolist_new_var_time (VALUE class, VALUE item,
c_item = StringValuePtr (item);
c_name = StringValuePtr (name);
c_value = NUM2ULL (value);
c_value = NUM2ULONG (value);
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(c_item),
c_name,
+10 -10
View File
@@ -2123,13 +2123,13 @@ API_FUNC(print)
API_FUNC(print_date_tags)
{
char *buffer, *tags, *message;
Tcl_WideInt date;
long date;
API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR);
if (objc < 5)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetWideIntFromObj (interp, objv[2], &date) != TCL_OK)
if (Tcl_GetLongFromObj (interp, objv[2], &date) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = Tcl_GetString (objv[1]);
@@ -2150,13 +2150,13 @@ API_FUNC(print_datetime_tags)
{
char *buffer, *tags, *message;
int date_usec;
Tcl_WideInt date;
long date;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
if (objc < 6)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetWideIntFromObj (interp, objv[2], &date) != TCL_OK)
if (Tcl_GetLongFromObj (interp, objv[2], &date) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetIntFromObj (interp, objv[3], &date_usec) != TCL_OK)
@@ -2205,7 +2205,7 @@ API_FUNC(print_y_date_tags)
{
char *buffer, *tags, *message;
int y;
Tcl_WideInt date;
long date;
API_INIT_FUNC(1, "print_y_date_tags", API_RETURN_ERROR);
if (objc < 6)
@@ -2214,7 +2214,7 @@ API_FUNC(print_y_date_tags)
if (Tcl_GetIntFromObj (interp, objv[2], &y) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetWideIntFromObj (interp, objv[3], &date) != TCL_OK)
if (Tcl_GetLongFromObj (interp, objv[3], &date) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = Tcl_GetString (objv[1]);
@@ -2236,7 +2236,7 @@ API_FUNC(print_y_datetime_tags)
{
char *buffer, *tags, *message;
int y, date_usec;
Tcl_WideInt date;
long date;
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (objc < 7)
@@ -2245,7 +2245,7 @@ API_FUNC(print_y_datetime_tags)
if (Tcl_GetIntFromObj (interp, objv[2], &y) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetWideIntFromObj (interp, objv[3], &date) != TCL_OK)
if (Tcl_GetLongFromObj (interp, objv[3], &date) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetIntFromObj (interp, objv[4], &date_usec) != TCL_OK)
@@ -4942,13 +4942,13 @@ API_FUNC(infolist_new_var_pointer)
API_FUNC(infolist_new_var_time)
{
const char *result;
Tcl_WideInt value;
long value;
API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY);
if (objc < 4)
API_WRONG_ARGS(API_RETURN_EMPTY);
if (Tcl_GetWideIntFromObj (interp, objv[3], &value) != TCL_OK)
if (Tcl_GetLongFromObj (interp, objv[3], &value) != TCL_OK)
API_WRONG_ARGS(API_RETURN_EMPTY);
result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(Tcl_GetString (objv[1])), /* item */