commit 4712d4646238cbd012adb1486fe151214600184a
parent c01b13a32c75b8760890bfa63b67acdc3cbd99a2
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 6 May 2021 13:06:22 +0200
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.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -2610,6 +2610,9 @@ void do_linter(void)
return;
}
+ /* Block resizing signals while reading from the pipe. */
+ block_sigwinch(TRUE);
+
/* Read in the returned syntax errors. */
totalread = 0;
buffersize = pipesize + 1;
@@ -2626,6 +2629,8 @@ void do_linter(void)
*pointer = '\0';
close(lint_fd[0]);
+ block_sigwinch(FALSE);
+
/* Process the linter output. */
pointer = lintings;
onelint = lintings;