Windows: Prevent NULL pointer dereference when ancestor is missing
authorChris Dickens <christopher.a.dickens@gmail.com>
Mon, 17 Aug 2020 15:40:33 +0000 (08:40 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Mon, 17 Aug 2020 15:40:33 +0000 (08:40 -0700)
commitaa6ec9d92e9109510650d121db7cc7bee76638a0
treedc6b07499bb1b3ef814f8999cd2cbca99273b92e
parentfa3f91e7c4c73fd233104cf3cad4890dd6121043
Windows: Prevent NULL pointer dereference when ancestor is missing

A buggy virtual USB device driver can cause the device enumeration
process to fail during the init_device() function when trying to
determine the bus number of the device. Guard against this by checking
that the ancestor device was actually found and skipping the bogus
device when there is no ancestor.

Closes #491

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/windows_winusb.c
libusb/version_nano.h