[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [50 character or so descriptive subject here (for reference)]
From: |
Chet Ramey |
Subject: |
Re: [50 character or so descriptive subject here (for reference)] |
Date: |
Tue, 17 Apr 2001 08:09:13 -0400 |
> Machine Type: sparc-sun-solaris2.7
>
> Bash Version: 2.05
> Patch Level: 0
> Release Status: release
>
> Description:
> bash segfaults on the first command execution
>
> Repeat-By:
>
>
> Fix:
> Tracking the error with a debugger and comparing 2.04 and 2.05
> version of stringlib.c I think there it's a simple copy & paste
> bug in stringlib.c: lines 222,223 come frome a part of code above
> and should most probably be simply removed. Here's the diff:
No, they should not. `ind', however, needs to be initialized. Try
instead adding
ind = r - ret;
before the call to RESIZE_MALLOCED_BUFFER and see if that fixes it.
*** ../bash-2.05/stringlib.c Wed Feb 14 17:00:42 2001
--- stringlib.c Tue Apr 17 08:10:29 2001
***************
*** 221,224 ****
--- 221,225 ----
p++;
+ ind = r - ret;
RESIZE_MALLOCED_BUFFER (ret, ind, 2, rlen, rlen);
r = ret + ind; /* in case reallocated */
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)
Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/