Thread (4 messages) 4 messages, 3 authors, 2023-11-03

Re: [PATCH 1/1] attr: enable attr pathspec magic for git-add and git-stash

From: Junio C Hamano <hidden>
Date: 2023-11-02 23:45:18

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] writes:
quoted
+	} else {
+		/* For an element in longhand form, we simply copy everything up to the final ')' */
A comment that is a bit on the overly-long side.
quoted
+		int len = strchr(element, ')') - element;
+		strbuf_add(sb, element, len);
In practice, nobody sane would write a pathspec magic that is over
2GB in size, so this would not matter unless we are facing a
potential attacker, but as the third parameter strbuf_add() takes is
of type size_t, it would not hurt to define "len" as the same type
as well.
Thanks for working on fixing this rather old bug.  I think we should
have noticed when we added the support for the "attr" magic to the
pathspec API.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help