"Jason A. Donenfeld" <[email protected]> on Wed, 2014/01/08 17:00: > Sorry for the extended nitpicks.... > > On Wed, Jan 8, 2014 at 4:23 PM, Christian Hesse <[email protected]> wrote: > > +char *cgit_get_gravatar(const char *email) > > +{ > > + > > + /* duplicate to lower and skip brackets! */ > > + lower = strdup(email + 1); > > + lower[strlen(lower) - 1] = '\0'; > > Can email ever be passed in with no length at all? Or without > brackets? It's not immediately clear to me from looking briefly at > parse_user in parsing.c.
A really good question. Let's think about parse_user()... If t does not
include brackets the string ends up in name. If it does include brackets the
address ends up in email, including the brackets. So does (mode == 2 && *p ==
'\n') ever get true? Probably we have a piece of dead code.
I think email always includes brackets or is NULL. In later case
cgit_get_gravatar() is not executed, so everything should be fine.
--
Schoene Gruesse
Chris
O< ascii ribbon campaign
stop html mail - www.asciiribbon.org
signature.asc
Description: PGP signature
_______________________________________________ CGit mailing list [email protected] http://lists.zx2c4.com/mailman/listinfo/cgit
