New function g_array_binary_search is buggy for large arrays
g_array_binary_search computes the middle point by doing:
middle = (left + right)/2;
This seems wrong. If left or right are too large, the sum may overflow. The situation is not even unrealistic since their type is guint so 32 bits unsigned and you can very well imagine a 3 GB array of 0x00 char with a 0xff needle somewhere in the upper half.
One should write middle = left + ((right - left) / 2);