edje: More off-by-one issues from Klocwork

Signed-off-by-one: Daniel Willmann <d.willmann@samsung.com>

SVN revision: 82770
This commit is contained in:
Daniel Willmann 2013-01-14 17:07:44 +00:00
parent a264f9c7c4
commit d2a6e45c80
3 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
2013-01-14 Daniel Willmann 2013-01-14 Daniel Willmann
* edje_embryo: Fix off-by-one error * edje: Fix off-by-one errors when using alloca in various functions
2013-01-14 Tom Hacohen (TAsn) 2013-01-14 Tom Hacohen (TAsn)

View File

@ -3200,7 +3200,7 @@ _edje_embryo_fn_external_param_get_choice(Embryo_Program *ep, Embryo_Cell *param
{ {
char *tmp = alloca(dst_len); char *tmp = alloca(dst_len);
memcpy(tmp, eep.s, dst_len - 1); memcpy(tmp, eep.s, dst_len - 1);
tmp[dst_len] = '\0'; tmp[dst_len-1] = '\0';
SETSTR(tmp, params[3]); SETSTR(tmp, params[3]);
} }
return 1; return 1;

View File

@ -1139,7 +1139,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
{ {
char *tmp; char *tmp;
tmp = alloca(end - idx - 1); tmp = alloca(end - idx);
memcpy(tmp, idx + 1, end - idx - 1); memcpy(tmp, idx + 1, end - idx - 1);
tmp[end - idx - 1] = '\0'; tmp[end - idx - 1] = '\0';
*idx = '\0'; *idx = '\0';