[PATCH] Fix crash when GIT_DIR is invalid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@xxxxxx>
---
 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

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]