From 50af47fd7c03aecb5bb9f248cac8ccbdb65c9b4c Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 30 Oct 2020 07:55:26 +0300 Subject: [PATCH] Isolation: fixed passing custom options to nmount(). The "iov" array was filled incorrectly when custom mounting options were set. --- src/nxt_fs.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/nxt_fs.c b/src/nxt_fs.c index 87d3b4a5..71498f99 100644 --- a/src/nxt_fs.c +++ b/src/nxt_fs.c @@ -172,8 +172,10 @@ nxt_fs_mount(nxt_task_t *task, nxt_fs_mount_t *mnt) *end = '\0'; - iov[iovlen++].iov_base = (void *) p; - iov[iovlen++].iov_len = (end - p) + 1; + iov[iovlen].iov_base = (void *) p; + iov[iovlen].iov_len = (end - p) + 1; + + iovlen++; p = end + 1; @@ -182,8 +184,10 @@ nxt_fs_mount(nxt_task_t *task, nxt_fs_mount_t *mnt) *end = '\0'; } - iov[iovlen++].iov_base = (void *) p; - iov[iovlen++].iov_len = nxt_strlen(p) + 1; + iov[iovlen].iov_base = (void *) p; + iov[iovlen].iov_len = nxt_strlen(p) + 1; + + iovlen++; } while (end != NULL && nxt_nitems(iov) > (iovlen + 2)); }