diff options
author | Tom Hacohen <tom@stosb.com> | 2015-12-08 12:55:06 +0000 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2015-12-08 12:55:33 +0000 |
commit | 48579d8e609d65a0e7e8ffde4b6e08bb6bced9ff (patch) | |
tree | 4944ee5f61722128a6fb478bf36f30fb68839477 | |
parent | 79399c08feebc99399769b39475e0133969c3473 (diff) | |
download | elementary-48579d8e609d65a0e7e8ffde4b6e08bb6bced9ff.tar.gz |
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
-rw-r--r-- | src/lib/elm_colorselector.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/elm_colorselector.c b/src/lib/elm_colorselector.c index d919e7ba1..8d69c63f5 100644 --- a/src/lib/elm_colorselector.c +++ b/src/lib/elm_colorselector.c @@ -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; |