aboutsummaryrefslogtreecommitdiff
path: root/contrib/libarchive/cpio/cmdline.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2024-04-29 08:15:04 +0000
committerMartin Matuska <mm@FreeBSD.org>2024-05-04 11:54:42 +0000
commit3a77c21a25e12fd60cc6093c74d4ad1a7f247319 (patch)
tree33d7466c14f7a4bfe5960c62de27f6426f9815c2 /contrib/libarchive/cpio/cmdline.c
parent43a6a8b07758c76576d1c505e770b937f84ad713 (diff)
downloadsrc-3a77c21a25e12fd60cc6093c74d4ad1a7f247319.tar.gz
src-3a77c21a25e12fd60cc6093c74d4ad1a7f247319.zip
libarchive: merge from vendor branch
Libarchive 3.7.4 + three fixes from master Security fixes: #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256) #2145 zip: Fix out of boundary access #2148 rar: Fix OOB in rar delta filter #2149 rar: Fix OOB in rar audio filter Important bugfixes: #2131 7zip: Limit amount of properties #2110 bsdtar: Fix error handling around strtol() usages #2116 passphrase: Never allow empty passwords #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives #2123 xar: Avoid infinite link loop #2150 xar: Fix another infinite loop and expat error handling #2108 zip: Update AppleDouble support for directories #2071 zstd: Implement core detectiongit PR: 278662 (exp-run) (cherry picked from commit 13d826ff947d9026f98e317e7385b22abfc0eace)
Diffstat (limited to 'contrib/libarchive/cpio/cmdline.c')
-rw-r--r--contrib/libarchive/cpio/cmdline.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/contrib/libarchive/cpio/cmdline.c b/contrib/libarchive/cpio/cmdline.c
index 312d762c8f46..ab25492ede48 100644
--- a/contrib/libarchive/cpio/cmdline.c
+++ b/contrib/libarchive/cpio/cmdline.c
@@ -114,12 +114,18 @@ cpio_getopt(struct cpio *cpio)
static int state = state_start;
static char *opt_word;
- const struct option *popt, *match = NULL, *match2 = NULL;
- const char *p, *long_prefix = "--";
+ const struct option *popt, *match, *match2;
+ const char *p, *long_prefix;
size_t optlength;
- int opt = '?';
- int required = 0;
+ int opt;
+ int required;
+again:
+ match = NULL;
+ match2 = NULL;
+ long_prefix = "--";
+ opt = '?';
+ required = 0;
cpio->argument = NULL;
/* First time through, initialize everything. */
@@ -169,7 +175,7 @@ cpio_getopt(struct cpio *cpio)
if (opt == '\0') {
/* End of this group; recurse to get next option. */
state = state_next_word;
- return cpio_getopt(cpio);
+ goto again;
}
/* Does this option take an argument? */