tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8854b9f72773f5b5a215d2e1477d064b647e34e9
commit 8854b9f72773f5b5a215d2e1477d064b647e34e9 Author: Vincent Torri <vincent dot torri at gmail dot com> Date: Wed Oct 14 09:58:19 2015 +0200 Eina: fix eina_file_current_directory_get() the length was not correctly computed and eina_file_path_sanitize() was was writing beyond the limit of the string @fix --- src/lib/eina/eina_file_win32.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c index 8139cad..a1371d7 100644 --- a/src/lib/eina/eina_file_win32.c +++ b/src/lib/eina/eina_file_win32.c @@ -423,21 +423,19 @@ eina_file_path_relative(const char *path) Eina_Tmpstr * eina_file_current_directory_get(const char *path, size_t len) { - char *cwd; char *tmp; DWORD l; l = GetCurrentDirectory(0, NULL); - if (l <= 0) return NULL; + if (l == 0) return NULL; - cwd = alloca(sizeof(char) * (l + 1)); - GetCurrentDirectory(l + 1, cwd); - len += l + 2; - tmp = alloca(sizeof (char) * len); - snprintf(tmp, len, "%s\\%s", cwd, path); - tmp[len - 1] = '\0'; + tmp = alloca(sizeof (char) * (l + len + 2)); + l = GetCurrentDirectory(l + 1, tmp); + tmp[l] = '\\'; + memcpy(tmp + l + 1, path, len); + tmp[l + len + 1] = '\0'; - return eina_tmpstr_add_length(tmp, len); + return eina_tmpstr_add_length(tmp, l + len + 1); } char * --