There're few problems with iotc_bsp_io_net_select():
It can be called with socket_events_array_size == 0. In this case,
poll() is still called with one struct pollfd, containing completely
uninitialized data.
Even if called with socket_events_array_size == 1, struct pollfd::events
is never fully initialized, just some bits in it are set, but it may contain
arbitrary value otherwise.
Finally, it can be potentially called with socket_events_array_size > 1,
in which case behavior will be undefined, definitely not what user expects.
All these cases are fixed, by initializing struct pollfd, checking and
returning error for case of socket_events_array_size > 1, and handling
socket_events_array_size == 0 properly.
There're few problems with iotc_bsp_io_net_select():
All these cases are fixed, by initializing struct pollfd, checking and returning error for case of socket_events_array_size > 1, and handling socket_events_array_size == 0 properly.