From mboxrd@z Thu Jan 1 00:00:00 1970 From: mail at eworm.de (Christian Hesse) Date: Thu, 9 Jan 2014 10:13:55 +0100 Subject: [PATCH 1/1] enable cgit to show gravatar for author, committer and tagger In-Reply-To: References: <1389194613-8660-1-git-send-email-mail@eworm.de> Message-ID: <20140109101355.0ddca426@leda.localdomain> "Jason A. Donenfeld" on Wed, 2014/01/08 17:00: > Sorry for the extended nitpicks.... > > On Wed, Jan 8, 2014 at 4:23 PM, Christian Hesse 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: