diff -ru a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c --- a/libsandbox/libsandbox.c 2010-08-16 13:04:14.000000000 +0000 +++ b/libsandbox/libsandbox.c 2010-10-12 17:14:03.000000000 +0000 @@ -174,11 +174,11 @@ if (NULL == egetcwd(resolved_path, SB_PATH_MAX - 2)) return -1; - char *copy = xstrdup(resolved_path); size_t len = strlen(resolved_path); snprintf(resolved_path + len, SB_PATH_MAX - len, "/%s", path); + char *copy = xstrdup(resolved_path); - char *ret = erealpath(resolved_path, resolved_path); + char *ret = erealpath(copy, resolved_path); free(copy); if (ret == NULL) { if (errno_is_too_long()) {