bugGNU nano - Bugs: bug #57934, writing a new file makes use of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #57934: writing a new file makes use of some uninitialized memory

Submitter:  Benno Schulenberg <bens>
Submitted:  Sun 01 Mar 2020 04:20:25 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Sun 01 Mar 2020 06:36:01 PM UTC, comment #1: 

Fixed in git, commit 6c34ae58.

(The problem existed since commit e8e30e51 from June last year.)

Benno Schulenberg <bens>
Group administrator
Sun 01 Mar 2020 04:20:25 PM UTC, original submission:  

When writing to a new, nonexistent file, valgrind compains about unitialized memory.

To reproduce, run 'valgrind src/nano README 2>TRAIL'.
Then type: ^O EE <Enter> Y ^X.
(This writes the README file under the name READMEEE.)
Now see that the TRAIL file contains something like:

==14257== Conditional jump or move depends on uninitialised value(s)
==14257==    at 0x113F10: write_file (files.c:1704)
==14257==    by 0x1154E3: do_writeout (files.c:2178)
==14257==    by 0x11D695: do_exit (nano.c:841)
==14257==    by 0x11EA4F: process_a_keystroke (nano.c:1606)
==14257==    by 0x11FF73: main (nano.c:2573)
==14257==  Uninitialised value was created by a stack allocation
==14257==    at 0x113E87: write_file (files.c:1481)

This does not happen when simply using ^S or ^O <Enter>, nor when giving the name of a file that already exists.

Benno Schulenberg <bens>
Group administrator

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (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.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-25 bens Open/ClosedOpen Closed
    2020-03-02 bens Summarywriting a new file complains about uninitialized memory writing a new file makes use of some uninitialized memory
    2020-03-01 bens Assigned toNone bens
    2020-03-01 bens StatusIn Progress Fixed
    2020-03-01 bens StatusNone In Progress
    2020-03-01 bens Summarywriting a new file complains about unitialized memory writing a new file complains about uninitialized memory

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code