summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-11-03 23:23:09 +0100
committerSébastien Helleu <flashcode@flashtux.org>2021-11-03 23:23:09 +0100
commit13472adfffb79fd39aa9d888ae27153dbf28896e (patch)
treefd30e1e5de96a2377847119bafafb9a7b24df585 /src
parent60b374901fb0be4e235559e20ea20fe60bdd3d6b (diff)
downloadweechat-13472adfffb79fd39aa9d888ae27153dbf28896e.zip
core: check that time is valid in function hdata_set
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-hdata.c2
1 files changed, 1 insertions, 1 deletions
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;