From 13472adfffb79fd39aa9d888ae27153dbf28896e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 3 Nov 2021 23:23:09 +0100 Subject: core: check that time is valid in function hdata_set --- src/core/wee-hdata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/wee-hdata.c b/src/core/wee-hdata.c index 976d09967..6580349db 100644 --- a/src/core/wee-hdata.c +++ b/src/core/wee-hdata.c @@ -1059,7 +1059,7 @@ hdata_set (struct t_hdata *hdata, void *pointer, const char *name, case WEECHAT_HDATA_TIME: error = NULL; number = strtol (value, &error, 10); - if (error && !error[0]) + if (error && !error[0] && (number >= 0)) { *((time_t *)(pointer + var->offset)) = (time_t)number; return 1; -- cgit v1.2.3