So glibc's qsort doesn't sort arrays of items when fed nonsense input? No kidding. Of course it won't. But reading off the end of the array is concerning.
At a higher level, who's misusing qsort in this way? I'd say PBCAK.
At a higher level, who's misusing qsort in this way? I'd say PBCAK.
Not only will it not sort them... it will lead to OOB memory accesses by qsort itself