Hi

I just looked at this bug and I wonder if nslint works correctly at all.
There are type mismatches in this exact mentioned spot.

qsort is called with "struct item **", so cmpaddr always gets "struct
item *".

| struct item **itemlist;
| qsort(itemlist, n, sizeof(itemlist[0]), cmpaddr);

But it interprets them as "const struct network *", not even as "const
struct addr *" as the name might imply.

| n1 = (const struct network *)arg1;
| n2 = (const struct network *)arg2;

I would assume this only works because on little endian the lower bytes
of the pointer to the hostname re-interpreted as family will change
between single allocations, but on big endian it will read the upper
bytes that do not change.

| if (n1->family != n2->family)
|   return ((n1->family == AF_INET) ? -1 : 1);

Bastian

-- 
We have found all life forms in the galaxy are capable of superior
development.
                -- Kirk, "The Gamesters of Triskelion", stardate 3211.7

Reply via email to