summaryrefslogtreecommitdiffstats
path: root/exclude.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:15:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:15:00 +0000
commited8873b14671073b4bd24d788dc61bcbf4fdfb14 (patch)
treed21da19c0d16a3169acbd9680382ceccad2bcad2 /exclude.c
parentAdding debian version 3.2.7-1. (diff)
downloadrsync-ed8873b14671073b4bd24d788dc61bcbf4fdfb14.tar.xz
rsync-ed8873b14671073b4bd24d788dc61bcbf4fdfb14.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;