device_probe.py: Extra error handling

This commit is contained in:
Mykola Grymalyuk
2023-04-13 07:25:45 -06:00
parent 62f619da99
commit 1fe710f4a3

View File

@@ -52,7 +52,7 @@ class PCIDevice:
if type(ioname) is bytes:
ioname = ioname.strip(b"\0").decode()
if ioname.startswith("pci"):
if ioname.startswith("pci") and "," in ioname:
vendor_id_unspoofed, device_id_unspoofed = (int(i, 16) for i in ioname[3:].split(","))
if anti_spoof:
vendor_id = vendor_id_unspoofed