Thread (6 messages) flat view 6 messages, 2 authors, 2016-06-15

Re: [PATCH] mktag.c: improve verification of tagger field and tests

From: Brandon Casey <hidden>
Date: 2016-06-15 22:44:26

Possibly related (same subject, not in this thread)

Junio C Hamano wrote:
By the way, I
   think tagger information should get the same validation as committer
   and author information gets elsewhere in the system;
I agree. Do you have any pointers to suggest? I haven't seen any place in
the code that does thorough validation. Usually, these fields are generated
within git, or converted to the internal form using some dwim procedure.

I keyed on get_ac_line() in builtin-blame.c and force_author in builtin-commit.c

builtin-commit.c searches for the angle brackets '<' and '>' as a validation
for the argument to --author.

get_ac_line() searches from the end of the string and sets tz, timestamp,
and email to the last space-separated entries. timestamp is fed to strtoul
and tz is fed to atoi. These two both skip leading space, but they are
never fed leading space from get_ac_line().

date.c:parse_date() keys on +\- to recognize timezone.

I think I'll make all of the optional components non-optional and make the
format a little stricter.

-brandon
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help