From: Martin Matuska Date: Mon, 2 Mar 2020 01:40:10 +0000 (+0100) Subject: cpio/cpio.c: Fix off-by-one in previous commit X-Git-Tag: v3.4.3~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33d74f279be081a266277cffdfe6c5073f1e1b91;p=thirdparty%2Flibarchive.git cpio/cpio.c: Fix off-by-one in previous commit --- diff --git a/cpio/cpio.c b/cpio/cpio.c index c9ffe76bd..c15ee525f 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -1235,7 +1235,7 @@ mode_pass(struct cpio *cpio, const char *destdir) memcpy(cpio->destdir, destdir, cpio->destdir_len); if (cpio->destdir_len == 0 || destdir[cpio->destdir_len - 1] != '/') cpio->destdir[cpio->destdir_len++] = '/'; - cpio->destdir[cpio->destdir_len + 1] = '\0'; + cpio->destdir[cpio->destdir_len] = '\0'; cpio->archive = archive_write_disk_new(); if (cpio->archive == NULL)