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

[PATCH] apply --cached: fix crash in subdirectory

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 21, 2007, 01:17 UTC
Message-ID
<Pine.LNX.4.63.0701210212410.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<20070120183615.GA6459@admingilde.org>

The static variable "prefix" was shadowed by an unused parameter of the same name. In case of execution in a subdirectory, the static variable was accessed, leading to a crash.

Signed-off-by: Knoppix User <knoppix@zweitrechner.(none)>
---
	On Sat, 20 Jan 2007, Martin Waitz wrote:
	
	> git-apply inside the "src" directory segfaulted.
	Well, that was not the complete truth now, was it? Cannily, you 
	avoided mentioning the use of the "--cached" argument...
	But as you see, your evil plan failed ;-)
 builtin-apply.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-apply.c b/builtin-apply.c
index 54fd2cb..ef927f8 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -2589,7 +2589,7 @@ static int git_apply_config(const char *var, const char *value)
 }
 
 
-int cmd_apply(int argc, const char **argv, const char *prefix)
+int cmd_apply(int argc, const char **argv, const char *prefix2)
 {
 	int i;
 	int read_stdin = 1;
-- 
1.5.0.rc1.gd85c
Previous: Martin WaitzNext: Martin Waitz
Message 4 of 7 in “SEGV in git-apply”
  1. Martin WaitzJan 20, 2007
  2. Johannes SchindelinJan 20, 2007
  3. Martin WaitzJan 20, 2007
  4. apply --cached: fix crash in subdirectoryJohannes Schindelin, Jan 21, 2007
  5. Martin WaitzJan 21, 2007
  6. Rogan DawesJan 21, 2007
  7. Johannes SchindelinJan 21, 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.