Colorselector: Fix out of bound read.

high should be the last item of the array, not the length of the array.
As part of this change, I also changed the code to use the better way of
getting the array size.

CID1339827
This commit is contained in:
Tom Hacohen 2015-12-08 12:55:06 +00:00
parent 2c686c83c8
commit 4df0ca1168
1 changed files with 1 additions and 1 deletions

View File

@ -203,7 +203,7 @@ _get_color_name (unsigned int R, unsigned int G, unsigned int B, unsigned int A)
if (A != 255) return NULL;
low = 0;
high = sizeof(_color_name)/ sizeof(_color_name[0]);
high = EINA_C_ARRAY_LENGTH(_color_name) - 1;
while (low <= high)
{
mid = (low + high) / 2;