Git development
 help / color / mirror / Atom feed
* [PATCH] fast-export: don't segfault when marks file cannot be opened
@ 2010-03-28  5:42 Sverre Rabbelier
  2010-03-28  5:45 ` Sverre Rabbelier
  0 siblings, 1 reply; 3+ messages in thread
From: Sverre Rabbelier @ 2010-03-28  5:42 UTC (permalink / raw)
  To: Junio C Hamano, Johannes Schindelin, Pieter de Bie, Git List
  Cc: Sverre Rabbelier

The error function only prints an error message, resulting in a
segfault if we later on try to fprintf to a NULL handle.

Fix this by using die_errno instead.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
---

  This has been proken ever since this functionality was added in
  df6a7ff7 (add importing and exporting of revision marks) on
  Jun 11 2008 by Pieter de Bie (cc-ed). All other error calls
  seem to be appropriate.

  This should probably be applied to maint?

 builtin/fast-export.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index b0a4029..963e89b 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -503,7 +503,7 @@ static void export_marks(char *file)
 
 	f = fopen(file, "w");
 	if (!f)
-		error("Unable to open marks file %s for writing.", file);
+		die_errno("Unable to open marks file %s for writing", file);
 
 	for (i = 0; i < idnums.size; i++) {
 		if (deco->base && deco->base->type == 1) {
-- 
1.7.0.2.333.g70ce.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fast-export: don't segfault when marks file cannot be  opened
  2010-03-28  5:42 [PATCH] fast-export: don't segfault when marks file cannot be opened Sverre Rabbelier
@ 2010-03-28  5:45 ` Sverre Rabbelier
  2010-03-28 16:26   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Sverre Rabbelier @ 2010-03-28  5:45 UTC (permalink / raw)
  To: Junio C Hamano, Johannes Schindelin, Pieter de Bie, Git List

Heya,

On Sat, Mar 27, 2010 at 23:42, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> -               error("Unable to open marks file %s for writing.", file);
> +               die_errno("Unable to open marks file %s for writing", file);

Heh, and of course I manage to mess up a 3-byte patch. The '.' removal
shouldn't be there of course.

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fast-export: don't segfault when marks file cannot be  opened
  2010-03-28  5:45 ` Sverre Rabbelier
@ 2010-03-28 16:26   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2010-03-28 16:26 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Johannes Schindelin, Pieter de Bie, Git List

Sverre Rabbelier <srabbelier@gmail.com> writes:

> Heh, and of course I manage to mess up a 3-byte patch. The '.' removal
> shouldn't be there of course.

Will fix it up here.  Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-28 16:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-28  5:42 [PATCH] fast-export: don't segfault when marks file cannot be opened Sverre Rabbelier
2010-03-28  5:45 ` Sverre Rabbelier
2010-03-28 16:26   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox