bugGNU patch - Bugs: bug #53228, git-style patch on nonexistent...

 
 

bug #53228: git-style patch on nonexistent file causes stack overflow

Submitter:  Laszlo Boszormenyi (GCS) <gcs>
Submitted:  Mon 26 Feb 2018 06:21:33 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 27 Jun 2019 10:57:37 PM UTC, comment #2: 

It turns out that this is a duplicate of bug #54845, which the following commit fixes:

commit b7b028a77bd855f6f56b17c8837fc1cca77b469d

Abort when cleaning up fails

When a fatal error triggers during cleanup, another attempt will be made to
clean up, which will likely lead to the same fatal error.  So instead, bail
out when that happens.
src/patch.c (cleanup): Bail out when called recursively.
(main): There is no need to call output_files() before cleanup() as cleanup()
already does that.

Andreas Gruenbacher <agruen>
Group administrator
Sun 26 Aug 2018 02:37:55 PM UTC, comment #1: 
Thomas Deutschmann <whissi>
Mon 26 Feb 2018 06:21:33 PM UTC, original submission:  

patch crashes when trying to apply a git-style patch to a nonexistent file:
$ patch -p1 nonexistent < git.diff
 patching file nonexistent
 Hunk #1 FAILED at 1.
 1 out of 1 hunk FAILED -- saving rejects to file nonexistent.rej
 patch: ** Can't reopen file nonexistent : No such file or directory
 patch: ** Can't reopen file nonexistent : No such file or directory
 patch: ** Can't reopen file nonexistent : No such file or directory
 [... hundreds of identical warnings ...]
 patch: ** Can't reopen file nonexistent : No such file or directory
 patch: ** Can't reopen file nonexistent : No such file or directory
 patch: ** Can't reopen file nonexistent : No such file or directory
 patch: ** Can't reopen file nonexistent : Too many open files
 patch: ** Can't create file nonexistent.orig : Too many open files
 patch: ** Can't create file nonexistent.orig : Too many open files
 patch: ** Can't create file nonexistent.orig : Too many open files
 [... hundreds of identical warnings ...]
 patch: ** Can't create file nonexistent.orig : Too many open files
 patch: ** Can't create file nonexistent.orig : Too many open files
 patch: ** Can't create file nonexistent.orig : Too many open files
 patch: ** Can't create file nonexistent.origSegmentation fault

Laszlo Boszormenyi (GCS) <gcs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #43400:  git.diff added by gcs (53B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by agruen (Posted a comment)
  • -email is unavailable- added by whissi (Posted a comment)
  • -email is unavailable- added by gcs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-06-27 agruen StatusNone Fixed
        Open/ClosedOpen Closed
    2018-02-26 gcs Attached File- Added git.diff, #43400

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code