From f8fc01d7bc4ba26bbd64446075a2d65fc75d0ef4 Mon Sep 17 00:00:00 2001 From: Phaedrus Leeds Date: Fri, 18 Feb 2022 08:59:58 -0600 Subject: [PATCH] Protect against --args being used twice Found by coverity CID 1471678 in flatpak --- bubblewrap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bubblewrap.c b/bubblewrap.c index 2f2fca55..e7a3e256 100644 --- a/bubblewrap.c +++ b/bubblewrap.c @@ -1662,6 +1662,9 @@ parse_args_recurse (int *argcp, if (argv[1][0] == 0 || endptr[0] != 0 || the_fd < 0) die ("Invalid fd: %s", argv[1]); + if (opt_args_data != NULL) + die ("--args can only be used once"); + /* opt_args_data is essentially a recursive argv array, which we must * keep allocated until exit time, since its argv entries get used * by the other cases in parse_args_recurse() when we recurse. */