summaryrefslogtreecommitdiff
path: root/pretty.h
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-02-28 11:22:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-11 21:22:44 (GMT)
commit96099726ddb00b45135964220ce56468ba9fe184 (patch)
tree67511a24e20bf148d232a8595719cb8bf48d4077 /pretty.h
parent273c9901c2ebfb2dae0c52de912bf3f57be19aac (diff)
downloadgit-96099726ddb00b45135964220ce56468ba9fe184.zip
git-96099726ddb00b45135964220ce56468ba9fe184.tar.gz
git-96099726ddb00b45135964220ce56468ba9fe184.tar.bz2
archive: expand only a single %(describe) per archive
Every %(describe) placeholder in $Format:...$ strings in files with the attribute export-subst is expanded by calling git describe. This can potentially result in a lot of such calls per archive. That's OK for local repositories under control of the user of git archive, but could be a problem for hosted repositories. Expand only a single %(describe) placeholder per archive for now to avoid denial-of-service attacks. We can make this limit configurable later if needed, but let's start out simple. Reported-by: Jeff King <peff@peff.net> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.h')
-rw-r--r--pretty.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/pretty.h b/pretty.h
index 7ce6c0b..27b1594 100644
--- a/pretty.h
+++ b/pretty.h
@@ -23,6 +23,10 @@ enum cmit_fmt {
CMIT_FMT_UNSPECIFIED
};
+struct pretty_print_describe_status {
+ unsigned int max_invocations;
+};
+
struct pretty_print_context {
/*
* Callers should tweak these to change the behavior of pp_* functions.
@@ -44,6 +48,7 @@ struct pretty_print_context {
int color;
struct ident_split *from_ident;
unsigned encode_email_headers:1;
+ struct pretty_print_describe_status *describe_status;
/*
* Fields below here are manipulated internally by pp_* functions and