diff --git a/ChangeLog b/ChangeLog index 63da5f1056..9dc2bf7e4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 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) diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c index 1697a3886c..ff5a4a9333 100644 --- a/src/lib/edje/edje_embryo.c +++ b/src/lib/edje/edje_embryo.c @@ -3200,7 +3200,7 @@ _edje_embryo_fn_external_param_get_choice(Embryo_Program *ep, Embryo_Cell *param { char *tmp = alloca(dst_len); memcpy(tmp, eep.s, dst_len - 1); - tmp[dst_len] = '\0'; + tmp[dst_len-1] = '\0'; SETSTR(tmp, params[3]); } return 1; diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c index f1e8a772d2..e4d9e81a40 100644 --- a/src/lib/edje/edje_program.c +++ b/src/lib/edje/edje_program.c @@ -1139,7 +1139,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f { char *tmp; - tmp = alloca(end - idx - 1); + tmp = alloca(end - idx); memcpy(tmp, idx + 1, end - idx - 1); tmp[end - idx - 1] = '\0'; *idx = '\0';