git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Don't rely on unspecified behavior

From
Thomas Schwinge <tschwinge@gnu.org>
Date
Jul 28, 2007, 16:39 UTC
Message-ID
<11856407791617-git-send-email-tschwinge@gnu.org>
In-Reply-To
<11856407793933-git-send-email-tschwinge@gnu.org>

Calling access(p, m) with p == NULL is not specified, so don't do that. On GNU/Hurd systems doing so will result in an 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 5e6748f..c13c738 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -74,7 +74,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
Previous: Thomas SchwingeNext: Thomas Glanzmann
Message 2 of 11 in “Support building on GNU/Hurd”
  1. Support building on GNU/HurdThomas Schwinge, Jul 28, 2007
  2. Don't rely on unspecified behaviorThomas Schwinge, Jul 28, 2007
  3. Thomas GlanzmannJul 28, 2007
  4. Thomas SchwingeJul 28, 2007
  5. Don't rely on unspecified behaviorThomas Schwinge, Jul 28, 2007
  6. Johannes SchindelinJul 28, 2007
  7. Thomas GlanzmannJul 28, 2007
  8. Johannes SchindelinJul 28, 2007
  9. Thomas GlanzmannJul 28, 2007
  10. Thomas SchwingeJul 28, 2007
  11. Johannes SchindelinJul 28, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.