mirror of
git://git.sv.gnu.org/nano.git
synced 2024-12-29 05:39:55 +03:00
linter: block the resizing signal while reading output from the linter
This prevents read() from returning unexpectedly and causing a crash. This fixes https://savannah.gnu.org/bugs/?60537. Reported-by: Filips Romāns <frfilips@gmail.com> Bug existed since version 2.4.2, since the handling of SIGWINCH changed.
This commit is contained in:
parent
c01b13a32c
commit
4712d46462
@ -2610,6 +2610,9 @@ void do_linter(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Block resizing signals while reading from the pipe. */
|
||||||
|
block_sigwinch(TRUE);
|
||||||
|
|
||||||
/* Read in the returned syntax errors. */
|
/* Read in the returned syntax errors. */
|
||||||
totalread = 0;
|
totalread = 0;
|
||||||
buffersize = pipesize + 1;
|
buffersize = pipesize + 1;
|
||||||
@ -2626,6 +2629,8 @@ void do_linter(void)
|
|||||||
*pointer = '\0';
|
*pointer = '\0';
|
||||||
close(lint_fd[0]);
|
close(lint_fd[0]);
|
||||||
|
|
||||||
|
block_sigwinch(FALSE);
|
||||||
|
|
||||||
/* Process the linter output. */
|
/* Process the linter output. */
|
||||||
pointer = lintings;
|
pointer = lintings;
|
||||||
onelint = lintings;
|
onelint = lintings;
|
||||||
|
Loading…
Reference in New Issue
Block a user