bugGNU nano - Bugs: bug #57932, executing an external command...

 
 

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

bug #57932: executing an external command refers to uninitialized memory

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

Sun 01 Mar 2020 04:10:25 PM UTC, comment #3: 

Fixed in git, commit 4409b275.

Benno Schulenberg <bens>
Group administrator
Sun 01 Mar 2020 04:05:03 PM UTC, comment #2: 

Hmm.  Maybe it's different because  for install_handler_for_Ctrl_C() 'newaction' is a global variable instead of allocated on the stack?

Benno Schulenberg <bens>
Group administrator
Sun 01 Mar 2020 04:01:56 PM UTC, comment #1: 

Why does it not complain about uninitialized memory when install_handler_for_Ctrl_C() is called in open_buffer() and open_file()?  That function performs the exact same sigaction() operation.

Benno Schulenberg <bens>
Group administrator
Sun 01 Mar 2020 03:14:02 PM UTC, original submission:  

To reproduce, run with valgrind: src/nano --ignore README.
Then type: ^R ^X echo foo <Enter> ^X ^N.

See that valgrind's outpout reports uninitialized bytes in execute_command(), something like:

==7795== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s)
==7795==    at 0x52D3FED: __libc_sigaction (sigaction.c:62)
==7795==    by 0x40953D: execute_command (files.c:1130)
==7795==    by 0x409988: do_insertfile (files.c:1286)
==7795==    by 0x412F7D: process_a_keystroke (nano.c:1606)
==7795==    by 0x4142EB: main (nano.c:2573)
==7795==  Address 0x1ffefff908 is on thread 1's stack
==7795==  in frame #0, created by __libc_sigaction (sigaction.c:47)
==7795==  Uninitialised value was created by a stack allocation
==7795==    at 0x409326: execute_command (files.c:1029)

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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-03-25 bens Open/ClosedOpen Closed
    2020-03-01 bens Summaryexecuting an external command refers tp uninitialized memory executing an external command refers to uninitialized memory
    2020-03-01 bens Summaryexecuting an external command makes uses of uninitialized memory executing an external command refers tp uninitialized memory
    2020-03-01 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code