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

tcl: fix conversion of dates in the API functions

On modern 32-bit platforms with a 64-bit time_t, long is 32-bit but time_t is
64-bit.

Replace calls to Tcl_GetLongFromObj by Tcl_GetWideIntFromObj.
This commit is contained in:
Sébastien Helleu
2026-06-21 07:49:48 +02:00
parent 75b364cd89
commit a4b8d7aedd
2 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ 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: fix conversion of dates in the API functions
- 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))
- 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))
+10 -10
View File
@@ -2123,13 +2123,13 @@ API_FUNC(print)
API_FUNC(print_date_tags)
{
char *buffer, *tags, *message;
long date;
Tcl_WideInt date;
API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR);
if (objc < 5)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetLongFromObj (interp, objv[2], &date) != TCL_OK)
if (Tcl_GetWideIntFromObj (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;
long date;
Tcl_WideInt date;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
if (objc < 6)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetLongFromObj (interp, objv[2], &date) != TCL_OK)
if (Tcl_GetWideIntFromObj (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;
long date;
Tcl_WideInt 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_GetLongFromObj (interp, objv[3], &date) != TCL_OK)
if (Tcl_GetWideIntFromObj (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;
long date;
Tcl_WideInt 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_GetLongFromObj (interp, objv[3], &date) != TCL_OK)
if (Tcl_GetWideIntFromObj (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;
long value;
Tcl_WideInt value;
API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY);
if (objc < 4)
API_WRONG_ARGS(API_RETURN_EMPTY);
if (Tcl_GetLongFromObj (interp, objv[3], &value) != TCL_OK)
if (Tcl_GetWideIntFromObj (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 */