git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Fix crash when GIT_DIR is invalid
@ 2006-08-04 15:46 Johannes Schindelin
  2006-08-04 18:56 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2006-08-04 15:46 UTC (permalink / raw
  To: git, junkio


We used to test if a pointer was NULL, and if it was, try to access it.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/setup.c b/setup.c
index 358e139..2afdba4 100644
--- a/setup.c
+++ b/setup.c
@@ -184,7 +184,7 @@ const char *setup_git_directory_gently(i
 		}
 		return NULL;
 	bad_dir_environ:
-		if (!nongit_ok) {
+		if (nongit_ok) {
 			*nongit_ok = 1;
 			return NULL;
 		}
-- 
1.4.2.rc2.g0bca-dirty

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

* Re: [PATCH] Fix crash when GIT_DIR is invalid
  2006-08-04 15:46 [PATCH] Fix crash when GIT_DIR is invalid Johannes Schindelin
@ 2006-08-04 18:56 ` Junio C Hamano
  2006-08-04 22:42   ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-08-04 18:56 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>  	bad_dir_environ:
> -		if (!nongit_ok) {
> +		if (nongit_ok) {
>  			*nongit_ok = 1;

*BLUSH*  How could I have missed something like this...

Thanks.

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

* Re: [PATCH] Fix crash when GIT_DIR is invalid
  2006-08-04 18:56 ` Junio C Hamano
@ 2006-08-04 22:42   ` Johannes Schindelin
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2006-08-04 22:42 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git

Hi,

On Fri, 4 Aug 2006, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> >  	bad_dir_environ:
> > -		if (!nongit_ok) {
> > +		if (nongit_ok) {
> >  			*nongit_ok = 1;
> 
> *BLUSH*  How could I have missed something like this...

It's too easy. I actually reviewed that patch, saw that I did the same 
(not!), and hit the bug...

Ciao,
Dscho "errare humanum est" --

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

end of thread, other threads:[~2006-08-04 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-04 15:46 [PATCH] Fix crash when GIT_DIR is invalid Johannes Schindelin
2006-08-04 18:56 ` Junio C Hamano
2006-08-04 22:42   ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).