GPtrArray might call qsort() with NULL data
Example:
GPtrArray *p = g_ptr_array_new (();
g_assert (p->pdata == NULL);
g_ptr_array_sort (p, NULL);
Because g_ptr_array_new()
calls ptr_array_new (0, NULL)
, ->pdata
will be left as NULL
, which g_ptr_array_sort()
just passes on to g_qsort_with_data
, which already has its first parameter annotated as (not nullable)
.
Ignoring that, since n
is 0
, the following call to msort_r()
will call g_allca(0)
, which is just alloca(0)
which... is questionable at best.