diff --git a/qubesusbproxy/core3ext.py b/qubesusbproxy/core3ext.py index 96eb5e6..ae8fd8a 100644 --- a/qubesusbproxy/core3ext.py +++ b/qubesusbproxy/core3ext.py @@ -299,9 +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() + if any(h not in b'0123456789abcdefABCDEF' + for h in hex_code): + raise ValueError() hex_value = int(hex_code, 16) c = chr(hex_value) except ValueError: