Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/nbxmpp
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2023-11-25 14:41:37 +0300
committerPhilipp Hörist <philipp@hoerist.com>2023-11-25 14:41:37 +0300
commit6e6ffb7b2427cae8d1200008ad0542cce81db29c (patch)
tree9b36902cd2f6e33fc8f2b5cfb164a8d850592590 /nbxmpp
parent2b0d2d18722a156aa26a4c64fa99ff6bb235543a (diff)
fix: DateTime: Be more strict with parsingHEADmaster
Don’t parse timestamps which may fail conversion to different timezones
Diffstat (limited to 'nbxmpp')
-rw-r--r--nbxmpp/modules/date_and_time.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nbxmpp/modules/date_and_time.py b/nbxmpp/modules/date_and_time.py
index d024bdd..5ff9bb7 100644
--- a/nbxmpp/modules/date_and_time.py
+++ b/nbxmpp/modules/date_and_time.py
@@ -160,6 +160,11 @@ def parse_datetime(
except ValueError:
return None
+ if not 1 < date_time.year < 9999:
+ # Raise/Reduce MIN/MAX year so converting to different
+ # timezones cannot get out of range
+ return None
+
if check_utc:
if convert != 'utc':
raise ValueError(