bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] NULL dereference on EOF in heredoc with history on


From: Chet Ramey
Subject: Re: [PATCH] NULL dereference on EOF in heredoc with history on
Date: Sun, 22 Mar 2009 13:03:58 -0400
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

Lubomir Rintel wrote:

> Bash Version: 4.0
> Patch Level: 10
> Release Status: release
> 
> Description:
>       If the heredoc input is terminted with end-of-file by pressing ^D
>       while history is on, bash enters an infinite loop (due to NULL
>       dereference along with a rather sick SIGSEGV handling, which will
>       probably be subject to a subsequent patch).

The SIGSEGV just needs to be handled immediately, the problem of doing
"too much" in a signal handler be damned:

*** ../bash-4.0-patched/sig.c   2009-01-04 14:32:41.000000000 -0500
--- sig.c       2009-03-21 14:31:30.000000000 -0400
***************
*** 449,452 ****
--- 449,457 ----
       int sig;
  {
+   /* If we get called twice with the same signal before handling it,
+      terminate right away. */
+   if (sig == terminating_signal)
+     terminate_immediately = 1;
+
    terminating_signal = sig;


Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]