bugGNU nano - Bugs: bug #65196, when the formatter command is...

 
 

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

bug #65196: when the formatter command is "", running the formatter crashes nano

Submitter:  correctmost <correctmost>
Submitted:  Tue 23 Jan 2024 06:55:09 PM UTC
   
 
Severity:  3 - Normal Status:  Fixed
Assigned to:  bens Open/Closed:  Open

Fri 26 Jan 2024 10:15:20 AM UTC, comment #1: 

Fixed in git, commit 367f84b0, by aborting the formatter when the command string is empty.

The fix is improved in commit 0e72c0d3, by stripping leading blanks from that string first.

Thanks for reporting.

Benno Schulenberg <bens>
Group administrator
Tue 23 Jan 2024 06:55:09 PM UTC, original submission:  

~/.nanorc contents:


syntax "txt" "\.txt"
color green "hi"
formatter ""


Steps to reproduce:
1 - nano foo1.txt
2 - Type "a"
3 - Ctrl + t then Ctrl + o to trigger the crash

Backtrace:


Program received signal SIGSEGV, Segmentation fault.
0x000063895a82ea00 in construct_argument_list (arguments=0x63895a84b7a0 <arguments>, command=0x63895b27efc0 "", filename=0x63895b283d60 "/tmp/nano.T9r5vD.txt") at text.c:2041
2041                (*arguments)[count - 2] = filename;
(gdb) p *arguments
$1 = (char **) 0x0
(gdb) bt
#0  0x000063895a82ea00 in construct_argument_list (arguments=0x63895a84b7a0 <arguments>, command=0x63895b27efc0 "", filename=0x63895b283d60 "/tmp/nano.T9r5vD.txt") at text.c:2041
#1  0x000063895a82ed0c in treat (tempfile_name=0x63895b283d60 "/tmp/nano.T9r5vD.txt", theprogram=0x63895b27efc0 "", spelling=false) at text.c:2133
#2  0x000063895a830df3 in do_formatter () at text.c:2947
#3  0x000063895a82201d in acquire_an_answer (actual=0x7ffd1810b634, listed=0x7ffd1810b633, history_list=0x63895a84b3a8 <execute_history>, refresh_func=0x63895a839f59 <edit_refresh>)
    at prompt.c:540
#4  0x000063895a822226 in do_prompt (menu=128, provided=0x63895b283ce0 "", history_list=0x63895a84b3a8 <execute_history>, refresh_func=0x63895a839f59 <edit_refresh>,
    msg=0x63895a83c701 "Command to execute") at prompt.c:596
#5  0x000063895a80faed in insert_a_file_or (execute=true) at files.c:1231
#6  0x000063895a80fecf in do_execute () at files.c:1384
#7  0x000063895a81eda9 in process_a_keystroke () at nano.c:1684
#8  0x000063895a820c0f in main (argc=2, argv=0x7ffd1810c118) at nano.c:2646


Version: 1a3ef7e497ccd5483dd537b17de07b150ebfa252

correctmost <correctmost>

 

(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 (Updated the item)
  • -email is unavailable- added by correctmost (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-01-26 bens StatusNone Fixed
    2024-01-24 bens Assigned toNone bens
        SummaryCrash when running formatter command with empty formatter argument when the formatter command is "", running the formatter crashes nano

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code