diff options
Diffstat (limited to 'ident.c')
| -rw-r--r-- | ident.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -59,7 +59,7 @@ static struct passwd *xgetpwuid_self(int *is_bogus) static void copy_gecos(const struct passwd *w, struct strbuf *name) { - char *src; + const char *src; /* Traditionally GECOS field had office phone numbers etc, separated * with commas. Also & stands for capitalized form of the login name. @@ -412,6 +412,10 @@ void apply_mailmap_to_header(struct strbuf *buf, const char **header, found_header = 1; buf_offset += endp - line; buf_offset += rewrite_ident_line(person, endp - person, buf, mailmap); + /* Recompute endp after potential buffer reallocation */ + endp = buf->buf + buf_offset; + if (*endp == '\n') + buf_offset++; break; } |
