From 686eda82b7256d8b9b139521747332b0b8a6c8b9 Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Sat, 22 Feb 2025 12:27:22 +0000 Subject: [PATCH] more hardening --- paranoia.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paranoia.py b/paranoia.py index 4e56e93..7d1f584 100644 --- a/paranoia.py +++ b/paranoia.py @@ -6,8 +6,8 @@ ENABLE_HARDENING = True def panic(reason:str): if not ENABLE_HARDENING: return - logger.error(f"hardening error: {reason}") - raise ValueError(f"hardening error: {reason}") + logger.error(f"hardening: {reason}") + raise ValueError(f"hardening: {reason}") # Throw if string contains any non-printable characters def assert_printable(v:str): @@ -81,7 +81,7 @@ def assert_valid_timestamp_seconds(v:int): if not ENABLE_HARDENING: return assert_valid_int(v) - if v < 0: + if v < 0 and v != -1: panic("timestamp is negative") if v > 2**31: panic("timestamp is too high")