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

Re: [PATCH] fix "git apply --index ..." not to deref NULL

From
Jeff King <peff@peff.net>
Date
Oct 12, 2011, 14:27 UTC
Message-ID
<20111012142750.GB25085@sigill.intra.peff.net>
In-Reply-To
<87lisq8vye.fsf@rho.meyering.net>
On Wed, Oct 12, 2011 at 10:18:01AM +0200, Jim Meyering wrote:
Show 10 quoted lines
> I noticed this when "git am CORRUPTED" unexpectedly failed with an
> odd diagnostic, and even removed one of the files it was supposed
> to have patched.
> 
> Reproduce with any valid old/new patch from which you have removed
> the "+++ b/FILE" line.  You'll see a diagnostic like this
> 
>     fatal: unable to write file '(null)' mode 100644: Bad address
> 
> and you'll find that FILE has been removed.
Yikes. Your fix looks right to me.
>  builtin/apply.c       |    3 +++
>  t/t4254-am-corrupt.sh |   43 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 46 insertions(+), 0 deletions(-)
>  create mode 100644 t/t4254-am-corrupt.sh
Missing executable bit on the new test.
-Peff
Previous: Jim MeyeringNext: Jim Meyering
Message 2 of 3 in “fix "git apply --index ..." not to deref NULL”
  1. fix "git apply --index ..." not to deref NULLJim Meyering, Oct 12, 2011
  2. Jeff KingOct 12, 2011
  3. Jim MeyeringOct 12, 2011

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.