[find-in-files] crash with search text ending in return character
I unintentionally pasted the wrong thing into the find-in-files search textbox and clicked 'find', resulting in gedit crashing.
Specifically I'd highlighted a short line of simple text along with the newline character on the end (preparing to move the line) and managed to forget that it was this I had in my clipboard rather than just the macro name when I went to search for other files containing it.
The crash is reliably reproducible. I'm using version 3.36.2-1 on Debian Sid.
To reproduce (obviously):
- open gedit and just hit the return key in a new document
- ctrl+a and ctrl+c
- open the find-in-files search dialog
- paste into the textbox, replacing the "\n" it had helpfully translated the clipboard to automatically, thus placing the raw return character into the textbox.
- hit 'find' and watch it crash
With the help of ghex I've confirmed that indeed the contents of the clipboard is just simple text followed by an 0x0A line-feed/newline character.
I ran gedit from a terminal to capture any output, which gave me the following:
ERROR:plugins/findinfiles/23f82b1@@findinfiles@sha/job.c:1219:gedit_find_in_files_plugin_find_job_get_line: code should not be reached
Bail out! ERROR:plugins/findinfiles/23f82b1@@findinfiles@sha/job.c:1219:gedit_find_in_files_plugin_find_job_get_line: code should not be reached
I tried alternatively having text after the return character and it does not crash with that.