From: Junio C Hamano Date: Tue, 13 Dec 2022 12:02:20 +0000 (+0900) Subject: Sync with Git 2.30.7 X-Git-Tag: v2.31.6~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=16128765d70f1375bcde3f27f51f85492b176a59;p=thirdparty%2Fgit.git Sync with Git 2.30.7 --- 16128765d70f1375bcde3f27f51f85492b176a59 diff --cc attr.c index 59a8d8af1a,f9316d14ba..f826ba21de --- a/attr.c +++ b/attr.c @@@ -729,11 -750,15 +750,15 @@@ static struct attr_stack *read_attr_fro if (!istate) return NULL; - buf = read_blob_data_from_index(istate, path, NULL); + buf = read_blob_data_from_index(istate, path, &size); if (!buf) return NULL; + if (size >= ATTR_MAX_FILE_SIZE) { + warning(_("ignoring overly large gitattributes blob '%s'"), path); + return NULL; + } - res = xcalloc(1, sizeof(*res)); + CALLOC_ARRAY(res, 1); for (sp = buf; *sp; ) { char *ep; int more;