From 6a7b8adb9c70593159831161659de2d2898045f0 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 15 Jan 2016 02:40:00 -0500 Subject: [PATCH] Restore modified path after lstat check_symlinks is intended to check each component of a path, but failed to restore the stripped trailing components after each iteration, leaving a NUL byte in the middle of the path. --- libarchive/archive_write_disk_posix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 0fc61930c..1eb0e91d7 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -2447,6 +2447,9 @@ check_symlinks(struct archive_write_disk *a) return (ARCHIVE_FAILED); } } + pn[0] = c; + if (pn[0] != '\0') + pn++; /* Advance to the next segment. */ } pn[0] = c; /* We've checked and/or cleaned the whole path, so remember it. */ -- 2.47.2