Skip to content

Commit

Permalink
q-dev: handle invalid values
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Jun 18, 2024
1 parent 18abd26 commit 29d32c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions qubesusbproxy/core3ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ def _sanitize(
break
hex_code = untrusted_device_desc[i - 1: i + 1]
try:
for i in range(2):
if hex_code[i] not in b'0123456789abcdefABCDEF':
raise ValueError()
hex_value = int(hex_code, 16)
c = chr(hex_value)
except ValueError:
Expand Down

0 comments on commit 29d32c5

Please sign in to comment.