Public bug reported:

Binary package hint: bash

If the value of the environment variable TERM starts with "eterm" and
the EMACS env var is unset, bash will segfault.  The cause is not
checking that getenv() is returning NULL when EMACS is unset.

To reproduce:
unset EMACS; TERM=eterm bash

Versions:
Ubuntu 9.10
bash 4.0-5ubuntu2

See this Fedora bug report for detail and a patch: 
https://bugzilla.redhat.com/show_bug.cgi?id=530911
--- bash-4.0/shell.c.orig       2009-10-15 15:57:56.000000000 -0400
+++ bash-4.0/shell.c    2009-10-15 15:58:28.000000000 -0400
@@ -572,7 +572,7 @@ 
 
       /* running_under_emacs == 2 for `eterm' */
       running_under_emacs = (emacs != 0) || (term && STREQN (term, "emacs", 
5));
-      running_under_emacs += term && STREQN (term, "eterm", 5) && strstr 
(emacs, "term");
+      running_under_emacs += term && STREQN (term, "eterm", 5) && (emacs != 0) 
&& strstr (emacs, "term");
 
       if (running_under_emacs)
        gnu_error_format = 1;

** Affects: bash (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  Binary package hint: bash
  
  If the value of the environment variable TERM starts with "eterm" and
  the EMACS env var is unset, bash will segfault.  The cause is not
  checking that getenv() is returning NULL when EMACS is unset.
  
  To reproduce:
- TERM=eterm bash
+ unset EMACS; TERM=eterm bash
  
  Versions:
  Ubuntu 9.10
  bash 4.0-5ubuntu2
  
  See this Fedora bug report for detail and a patch: 
https://bugzilla.redhat.com/show_bug.cgi?id=530911
  --- bash-4.0/shell.c.orig     2009-10-15 15:57:56.000000000 -0400
  +++ bash-4.0/shell.c  2009-10-15 15:58:28.000000000 -0400
  @@ -572,7 +572,7 @@ 
   
         /* running_under_emacs == 2 for `eterm' */
         running_under_emacs = (emacs != 0) || (term && STREQN (term, "emacs", 
5));
  -      running_under_emacs += term && STREQN (term, "eterm", 5) && strstr 
(emacs, "term");
  +      running_under_emacs += term && STREQN (term, "eterm", 5) && (emacs != 
0) && strstr (emacs, "term");
   
         if (running_under_emacs)
        gnu_error_format = 1;

-- 
bash segfaults when TERM=eterm*
https://bugs.launchpad.net/bugs/497637
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to