git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] archive: error instead of triggering a segfault in `git archive --remote=""`
@ 2025-03-09 10:12 emilylime via GitGitGadget
  2025-03-10  7:37 ` Patrick Steinhardt
  2025-03-10 11:25 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: emilylime via GitGitGadget @ 2025-03-09 10:12 UTC (permalink / raw)
  To: git; +Cc: emilylime, emilylime

From: emilylime <emilyyyylime+git@gmail.com>

Signed-off-by: emilylime <emilyyyylime+git@gmail.com>
---
    Error instead of triggering a segfault in git archive --remote=""

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1877%2Femilyyyylime%2Ffix-archive-remote-segfault-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1877/emilyyyylime/fix-archive-remote-segfault-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1877

 builtin/archive.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/builtin/archive.c b/builtin/archive.c
index 13ea7308c8b..b6fdbfc7dca 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -97,6 +97,10 @@ int cmd_archive(int argc,
 	argc = parse_options(argc, argv, prefix, local_opts, NULL,
 			     PARSE_OPT_KEEP_ALL);
 
+	if (remote && !remote[0]) {
+		usage(N_("Option 'remote' may not be left empty"));
+	}
+
 	init_archivers();
 
 	if (output)

base-commit: f93ff170b93a1782659637824b25923245ac9dd1
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-10 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-09 10:12 [PATCH] archive: error instead of triggering a segfault in `git archive --remote=""` emilylime via GitGitGadget
2025-03-10  7:37 ` Patrick Steinhardt
2025-03-10 15:59   ` Junio C Hamano
2025-03-10 11:25 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).