Skip to content

platform: fix binary search

When searching an element that is lower than the first list element (for example RTNL type "batadv"), imax will be -1 after the last iteration.

Use int instead of unsigned to make the termination condition imin > imax work in this case. This fixes NetworkManager crashing due to an out-of-bounds array access whenever interfaces of such types exist.

Fixes: 19ad0443 ('platform: use binary search to lookup NMLinkType for rtnl_type')

Edited by Matthias Schiffer

Merge request reports