exit on overlong passed data
This commit is contained in:
7
pin.run
7
pin.run
@@ -30,6 +30,13 @@ if os.path.getsize(database) < 100 * 1024 * 1024:
|
||||
# only add entries if file size does not exceed 100 MiB
|
||||
|
||||
if "ort" in args and "name" in args and "comment" in args:
|
||||
|
||||
# fail if input is too long
|
||||
if max(map(len, list(args[i] for i in args))) > 200:
|
||||
# overlong input is a clear indication someone is fiddling with the interface
|
||||
# this deserves no proper exit message
|
||||
exit()
|
||||
|
||||
# add entry
|
||||
try:
|
||||
zeit = datetime.timestamp(datetime(int(args["year"]), int(args["month"]), int(args["day"]), int(args["hour"]), int(args["minute"])))
|
||||
|
||||
Reference in New Issue
Block a user