summaryrefslogtreecommitdiffstats
path: root/exclude.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:15:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:15:01 +0000
commit28e02ede59c9edf5e806985df9f05a3344945d7f (patch)
tree989fc0575334db3836990eb814636f5c8276589f /exclude.c
parentReleasing progress-linux version 3.2.7-1~progress7.99u1. (diff)
downloadrsync-28e02ede59c9edf5e806985df9f05a3344945d7f.tar.xz
rsync-28e02ede59c9edf5e806985df9f05a3344945d7f.zip
Merging upstream version 3.3.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'exclude.c')
-rw-r--r--exclude.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/exclude.c b/exclude.c
index ffe55b1..87edbcf 100644
--- a/exclude.c
+++ b/exclude.c
@@ -4,7 +4,7 @@
* Copyright (C) 1996-2001 Andrew Tridgell <tridge@samba.org>
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2002 Martin Pool
- * Copyright (C) 2003-2022 Wayne Davison
+ * Copyright (C) 2003-2024 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -720,7 +720,8 @@ static BOOL setup_merge_file(int mergelist_num, filter_rule *ex,
parent_dirscan = True;
while (*y) {
char save[MAXPATHLEN];
- strlcpy(save, y, MAXPATHLEN);
+ /* copylen is strlen(y) which is < MAXPATHLEN. +1 for \0 */
+ size_t copylen = strlcpy(save, y, MAXPATHLEN) + 1;
*y = '\0';
dirbuf_len = y - dirbuf;
strlcpy(x, ex->pattern, MAXPATHLEN - (x - buf));
@@ -734,7 +735,7 @@ static BOOL setup_merge_file(int mergelist_num, filter_rule *ex,
lp->head = NULL;
}
lp->tail = NULL;
- strlcpy(y, save, MAXPATHLEN);
+ strlcpy(y, save, copylen);
while ((*x++ = *y++) != '/') {}
}
parent_dirscan = False;