From: Wayne Davison Date: Sat, 8 May 2004 20:03:39 +0000 (+0000) Subject: Changed the non-globbing version of glob_expand_one() so that it X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/4135d091a6751f6b209a8600720ab6ec183cd909 Changed the non-globbing version of glob_expand_one() so that it checks the maxargs argument instead of leaving it unused. --- diff --git a/util.c b/util.c index 9f28148a..6fe19fcd 100644 --- a/util.c +++ b/util.c @@ -499,7 +499,10 @@ static int exclude_server_path(char *arg) static void glob_expand_one(char *s, char **argv, int *argc, int maxargs) { #if !(defined(HAVE_GLOB) && defined(HAVE_GLOB_H)) - if (!*s) s = "."; + if (maxargs <= *argc) + return; + if (!*s) + s = "."; s = argv[*argc] = strdup(s); exclude_server_path(s); (*argc)++; @@ -508,12 +511,12 @@ static void glob_expand_one(char *s, char **argv, int *argc, int maxargs) glob_t globbuf; int i; - if (!*s) s = "."; + if (!*s) + s = "."; s = argv[*argc] = strdup(s); - if (sanitize_paths) { + if (sanitize_paths) sanitize_path(s, NULL); - } memset(&globbuf, 0, sizeof globbuf); if (!exclude_server_path(s))