summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 904b194)
raw | patch | inline | side by side (parent: 904b194)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 19 Aug 2007 09:50:18 +0000 (02:50 -0700) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 19 Aug 2007 17:11:01 +0000 (13:11 -0400) |
* skip_optional_lf() decl is old-style -- please say
static skip_optional_lf(void)
{
...
}
* t9300 #14 fails, like this:
* expecting failure: git-fast-import <input
fatal: Branch name doesn't conform to GIT standards: .badbranchname
fast-import: dumping crash report to .git/fast_import_crash_14354
./test-lib.sh: line 143: 14354 Segmentation fault git-fast-import <input
-- >8 --
Subject: [PATCH] fastimport: Fix re-use of va_list
The va_list is designed to be used only once. The current code
reuses va_list argument may cause segmentation fault. Copy and
release the arguments to avoid this problem.
While we are at it, fix old-style function declaration of
skip_optional_lf().
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
static skip_optional_lf(void)
{
...
}
* t9300 #14 fails, like this:
* expecting failure: git-fast-import <input
fatal: Branch name doesn't conform to GIT standards: .badbranchname
fast-import: dumping crash report to .git/fast_import_crash_14354
./test-lib.sh: line 143: 14354 Segmentation fault git-fast-import <input
-- >8 --
Subject: [PATCH] fastimport: Fix re-use of va_list
The va_list is designed to be used only once. The current code
reuses va_list argument may cause segmentation fault. Copy and
release the arguments to avoid this problem.
While we are at it, fix old-style function declaration of
skip_optional_lf().
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index 5085fbf116e57a59f488afa3f0055c9427efb3c9..2d5224c1867a081c592d21af1573264455a92aff 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
static NORETURN void die_nicely(const char *err, va_list params)
{
static int zombie;
+ va_list x_params;
+ va_copy(x_params, params);
fputs("fatal: ", stderr);
vfprintf(stderr, err, params);
fputc('\n', stderr);
if (!zombie) {
zombie = 1;
- write_crash_report(err, params);
+ write_crash_report(err, x_params);
}
-
+ va_end(x_params);
exit(128);
}
} while (command_buf.buf[0] == '#');
}
-static void skip_optional_lf()
+static void skip_optional_lf(void)
{
int term_char = fgetc(stdin);
if (term_char != '\n' && term_char != EOF)