bug-bash
[Top][All Lists]
Advanced

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

Re: array-related segfault in bash-3


From: Chet Ramey
Subject: Re: array-related segfault in bash-3
Date: Mon, 2 Aug 2004 10:12:56 -0400

> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 3.0
> Patch Level: 0
> Release Status: release
> 
> Description:
>       It is possible to segfault bash-3 by attempting to access a
>       local array in a function after it has been unset.
> 
> Repeat-By:
>       myfunc() { declare -a arr; unset arr; echo "${arr[*]}"; }
>       myfunc

Try this patch.

*** ../bash-3.0/arrayfunc.c     Fri Dec 19 00:03:09 2003
--- arrayfunc.c Sun Aug  1 20:43:00 2004
***************
*** 612,616 ****
  
    free (t);
!   return var;
  }
  
--- 612,616 ----
  
    free (t);
!   return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var;
  }
  

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    address@hidden    http://tiswww.tis.cwru.edu/~chet/




reply via email to

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