login
Header Space

 
 

[PATCH] Don't rely on unspecified behavior

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Cc: Thomas Schwinge <tschwinge@...>
Date: Saturday, July 28, 2007 - 2:26 pm

Calling access(p, m) with p == NULL is not specified, so don't do that.  On
GNU/Hurd systems doing so will result in a SIGSEGV.

Signed-off-by: Thomas Schwinge <tschwinge@gnu.org>
---
 builtin-add.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-add.c b/builtin-add.c
index 7345479..de5c108 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -60,7 +60,7 @@ static void fill_directory(struct dir_struct *dir, const char **pathspec,
 		path = git_path("info/exclude");
 		if (!access(path, R_OK))
 			add_excludes_from_file(dir, path);
-		if (!access(excludes_file, R_OK))
+		if (excludes_file != NULL && !access(excludes_file, R_OK))
 			add_excludes_from_file(dir, excludes_file);
 	}
 
-- 
1.5.3.rc3.26.g6c58-dirty

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Support building on GNU/Hurd, Thomas Schwinge, (Sat Jul 28, 12:39 pm)
[PATCH] Don't rely on unspecified behavior, Thomas Schwinge, (Sat Jul 28, 12:39 pm)
Re: [PATCH] Don't rely on unspecified behavior, Thomas Glanzmann, (Sat Jul 28, 1:39 pm)
[PATCH] Don't rely on unspecified behavior, Thomas Schwinge, (Sat Jul 28, 2:26 pm)
Re: [PATCH] Don't rely on unspecified behavior, Johannes Schindelin, (Sat Jul 28, 3:30 pm)
Re: [PATCH] Don't rely on unspecified behavior, Thomas Schwinge, (Sat Jul 28, 3:43 pm)
Re: [PATCH] Don't rely on unspecified behavior, Johannes Schindelin, (Sat Jul 28, 4:17 pm)
Re: [PATCH] Don't rely on unspecified behavior, Thomas Glanzmann, (Sat Jul 28, 3:34 pm)
Re: [PATCH] Don't rely on unspecified behavior, Johannes Schindelin, (Sat Jul 28, 4:16 pm)
Re: [PATCH] Don't rely on unspecified behavior, Thomas Glanzmann, (Sat Jul 28, 4:20 pm)
Re: [PATCH] Don't rely on unspecified behavior, Thomas Schwinge, (Sat Jul 28, 2:25 pm)
speck-geostationary