Commit 35f69263 authored by Uri Lublin's avatar Uri Lublin
Browse files

usb-backend: create_emulated_device: assert address < 32



This may fix the following static analyzer issue:
  src/usb-backend.c:1507: large_shift: In expression "1 << address", left
  shifting by more than 31 bits has undefined behavior.
  The shift amount, "address", is 32.
Signed-off-by: Uri Lublin's avatarUri Lublin <uril@redhat.com>
parent df47365c
......@@ -1482,6 +1482,9 @@ spice_usb_backend_create_emulated_device(SpiceUsbBackend *be,
}
}
// for static analyzers: it is already checked above
g_assert(address < 32);
dev = g_new0(SpiceUsbDevice, 1);
dev->device_info.bus = BUS_NUMBER_FOR_EMULATED_USB;
dev->device_info.address = address;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment