luxonis / XLink

A cross-platform library for communicating with devices over various physical links.
Apache License 2.0
11 stars 17 forks source link

incorrect use of memset corrupts `XLinkPlatformFindDevices()` out param #54

Closed diablodale closed 1 month ago

diablodale commented 1 year ago

memset() is used incorrectly causing corruption and/or not nulling the struct(s). For now, it appears an annoyance for debugging though definitely errant code. I recommend fixing.

Setup

Repro

found in code review during isolation of device closing errant behavior

https://github.com/luxonis/XLink/blob/d209b7eeb8ac68435df5097e57e1dfd8ea1d0e83/src/pc/PlatformDeviceSearch.c#L52

should be

memset(out_foundDevices, 0, sizeFoundDevices * sizeof(deviceDesc_t));