Revert "eina: eina_file - fix "invalid read of size 1" in valgrind"
authorDaniel Hirt <daniel.hirt@samsung.com>
Mon, 2 Feb 2015 12:10:04 +0000 (14:10 +0200)
committerDaniel Hirt <daniel.hirt@samsung.com>
Mon, 2 Feb 2015 12:41:37 +0000 (14:41 +0200)
This reverts commit f52f5628916f44a6b8ce1fdd3b9cc40f6c997eda.

This is reverted because it breaks eina_file_path_sanitize when using
  "/../" in paths, for example:
eina_file_path_sanitize("/home/../mydir/myfile")
  returns: "/mydir/myfili"

What invalid read size does this fix? Why was no test case specified?
Anyway, this change affects too much code to leave it in like this.

src/lib/eina/eina_file_common.c

index 6a573da..3e5b615 100644 (file)
@@ -88,7 +88,7 @@ _eina_file_escape(char *path, size_t len)
                    char tmp;
 
                    len -= p + 3 - q;
-                   memmove(q, p + 3, len - (q - result) - 1);
+                   memmove(q, p + 3, len - (q - result));
                    result[len] = '\0';
                    p = q;