projects
/
platform
/
upstream
/
efl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dad345e
)
eolian: fix out-of-bounds indexing on tokens
author
Daniel Kolesa
<d.kolesa@osg.samsung.com>
Sun, 4 Oct 2015 13:52:36 +0000
(14:52 +0100)
committer
Daniel Kolesa
<d.kolesa@osg.samsung.com>
Sun, 4 Oct 2015 13:54:21 +0000
(14:54 +0100)
Fixes CID 1324818 @fix
src/lib/eolian/eo_lexer.c
patch
|
blob
|
history
diff --git
a/src/lib/eolian/eo_lexer.c
b/src/lib/eolian/eo_lexer.c
index
bd78958
..
d14c70f
100644
(file)
--- a/
src/lib/eolian/eo_lexer.c
+++ b/
src/lib/eolian/eo_lexer.c
@@
-1148,8
+1148,9
@@
eo_lexer_token_to_str(int token, char *buf)
{
const char *v;
size_t idx = token - START_CUSTOM;
- if (idx >= sizeof(tokens))
- v = keywords[idx - sizeof(tokens)];
+ size_t tsz = sizeof(tokens) / sizeof(tokens[0]);
+ if (idx >= tsz)
+ v = keywords[idx - tsz];
else
v = tokens[idx];
memcpy(buf, v, strlen(v) + 1);