GNU nano - Bugs: bug #65279, use-after-free in goto_line_posx()
You are not allowed to post comments on this tracker with your current authentication level.
bug #65279: use-after-free in goto_line_posx()
Submitter: | correctmost <correctmost> | ||
Submitted: | Fri 09 Feb 2024 07:28:51 AM UTC | ||
Severity: | 3 - Normal | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Open |
Mon 12 Feb 2024 06:37:40 PM UTC, comment #5: |
correctmost <correctmost> |
Mon 12 Feb 2024 10:35:27 AM UTC, comment #4: Generating scripts that send random keystrokes to nano is a great idea. But somehow I cannot get `xdotool` to send keystrokes to another window, only to the current window. That can still work by running the random-keystrokes in the background and nano in the foreground, but how do you do it?
|
Benno Schulenberg <bens> |
Sat 10 Feb 2024 05:34:51 PM UTC, comment #3:
|
correctmost <correctmost> |
Sat 10 Feb 2024 11:18:40 AM UTC, comment #2: Fixed in git, commit 8fefee2d, by making sure 'openfile->current' stays valid when the line it refers to gets deleted. |
Benno Schulenberg <bens> |
Sat 10 Feb 2024 11:10:49 AM UTC, comment #1: Thanks for reporting, and for the clear recipe.
|
Benno Schulenberg <bens> |
Fri 09 Feb 2024 07:28:51 AM UTC, original submission:
Steps to reproduce:
|
correctmost <correctmost> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
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-02-10 | bens | Status | None | Fixed | |
2024-02-10 | bens | Assigned to | None | bens | |
Summary | Use-after-free in goto_line_posx | use-after-free in goto_line_posx() |
Powered by Savane 3.13-02a9.
Corresponding source code
comment #4:
I wasn't able to get `xdotool --window` to work with nano inside of xfce4-terminal.
There's a note on the xdotool man page that might shed some light on the issue, but for now I just sleep at the beginning of the script and manually focus the nano window.
I run the script in a test virtual machine to avoid disasters :). I also exclude the insert-file, save, and exit keystrokes to avoid interactions with the OS.
Another hazard is when nano crashes and xdotool starts sending commands to the shell. Adding a check like this before each command helps:
`if ! pgrep nano > /dev/null; then exit 1; fi`
My long-term plan is to figure out a way to send commands to nano in-process to avoid some of these complications. That could also make it possible to inspect the current state of the buffer to catch subtle bugs like the missing text you spotted in https://savannah.gnu.org/bugs/?65289#comment1.