Skip to content

Commit

Permalink
Add more input validation
Browse files Browse the repository at this point in the history
  • Loading branch information
argilo committed Mar 9, 2024
1 parent 6b3094e commit 83f07e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions secplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ def encode_wireline_command(rolling, device_id, command, payload):
Raises a ValueError if the rolling code, fixed code, or data is too large.
"""

if device_id >= 2**40:
raise ValueError("Device ID must be less than 2^40")
if command >= 2**12:
raise ValueError("Command must be less than 2^12")
if payload >= 2**20:
Expand Down

0 comments on commit 83f07e2

Please sign in to comment.