Re: [PATCH v1 6/8] perf maps: Avoid UB passing NULL to bsearch
From: Kuan-Wei Chiu
Date: Sat Dec 14 2024 - 07:35:22 EST
On Fri, Dec 13, 2024 at 01:04:23PM -0800, Ian Rogers wrote:
> If maps_by_address is NULL it is UB to pass it to bsearch, and will
> trigger ubsan, even if the nr_maps is 0.
>
> Fixes: 659ad3492b91 ("perf maps: Switch from rbtree to lazily sorted array for addresses")
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
Reviewed-by: Kuan-Wei Chiu <visitorckw@xxxxxxxxx>
Regards,
Kuan-Wei