git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] bugfix: segfault on git diff --output=/bad/path
@ 2010-02-16  4:10 Larry D'Anna
  2010-02-16  4:10 ` [PATCH 2/2] bugfix: git diff --quiet -w never returns with exit status 1 Larry D'Anna
  0 siblings, 1 reply; 5+ messages in thread
From: Larry D'Anna @ 2010-02-16  4:10 UTC (permalink / raw)
  To: git; +Cc: Larry D'Anna

The return value from fopen wasn't being checked.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
---
 diff.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/diff.c b/diff.c
index 381cc8d..68def6c 100644
--- a/diff.c
+++ b/diff.c
@@ -2893,6 +2893,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 		;
 	else if (!prefixcmp(arg, "--output=")) {
 		options->file = fopen(arg + strlen("--output="), "w");
+		if (!options->file)
+			die_errno("Could not open '%s'", arg + strlen("--output="));
 		options->close_file = 1;
 	} else
 		return 0;
-- 
1.7.0.rc2.40.g7d8aa

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

end of thread, other threads:[~2010-02-16  6:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-16  4:10 [PATCH 1/2] bugfix: segfault on git diff --output=/bad/path Larry D'Anna
2010-02-16  4:10 ` [PATCH 2/2] bugfix: git diff --quiet -w never returns with exit status 1 Larry D'Anna
2010-02-16  5:42   ` Junio C Hamano
2010-02-16  6:45     ` Larry D'Anna
2010-02-16  6:55       ` Larry D'Anna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).