os layer qsort

Joel Cunningham joel.cunningham at me.com
Fri Oct 7 14:28:06 PDT 2016


Hi,

I’ve run into an issue with hostap running on an embedded platform.  The qsort function from the standard C library data aborts when the list size is 0.  We’ve seen this happen in wpa_supplicant_get_scan_results() with a zero-sized scan results.  A zero-sized can results is probably not common, but this could be encountered with a device in an isolation chamber.

I’m wondering if the preferred solution is to introduce os_qsort in to the os.h abstraction layer that way I can add extra checks on the size before calling qsort.  I’m kind of surprised there isn’t an abstracted call already since qsort is typically implemented in the standard C library and would fall under the OS_N_C_LIB_DEFINE feature.

If this is the preferred approach, I’ll work up a patch.

Thanks,

Joel


More information about the Hostap mailing list