go-serial icon indicating copy to clipboard operation
go-serial copied to clipboard

Enumerator panics on windows when removing a device mid enumeration

Open advisoft opened this issue 3 years ago • 0 comments

panic: runtime error: index out of range [0] with length 0

goroutine 883 [running]:\ngo.bug.st/serial/enumerator.retrievePortDetailsFromDevInfo(0xc00011f3b0, 0xc000121560, 0x5, 0x0)
/go/pkg/mod/go.bug.st/[email protected]/enumerator/usb_windows.go:351 +0x365
go.bug.st/serial/enumerator.nativeGetDetailedPortsList(0x0, 0x0, 0x0, 0x0, 0x0)
/go/pkg/mod/go.bug.st/[email protected]/enumerator/usb_windows.go:299 +0x1b1
go.bug.st/serial/enumerator.GetDetailedPortsList(...)
/go/pkg/mod/go.bug.st/[email protected]/enumerator/enumerator.go:31

I suspect N needs a zero check on line 350: image

advisoft avatar May 10 '22 02:05 advisoft