From: Andrew Gregory Date: Fri, 15 Jan 2016 07:40:00 +0000 (-0500) Subject: Restore modified path after lstat X-Git-Tag: v3.1.901a~9^2~16^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a7b8adb9c70593159831161659de2d2898045f0;p=thirdparty%2Flibarchive.git 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. --- 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. */