summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 03eeaea)
raw | patch | inline | side by side (parent: 03eeaea)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 17 Jan 2007 19:13:02 +0000 (11:13 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 17 Jan 2007 20:03:50 +0000 (12:03 -0800) |
An incorrect config file can say:
[format]
headers
and crash the parsing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
[format]
headers
and crash the parsing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-log.c | patch | blob | history |
diff --git a/builtin-log.c b/builtin-log.c
index 7397a5af07c1bd1889d5c0bc2959060401f48829..1cd9d3f76834b40eb217cbb36784b85d5d076e3a 100644 (file)
--- a/builtin-log.c
+++ b/builtin-log.c
static int git_format_config(const char *var, const char *value)
{
if (!strcmp(var, "format.headers")) {
- int len = strlen(value);
+ int len;
+
+ if (!value)
+ die("format.headers without value");
+ len = strlen(value);
extra_headers_size += len + 1;
extra_headers = xrealloc(extra_headers, extra_headers_size);
extra_headers[extra_headers_size - len - 1] = 0;