Subject: PR/28852 CVS commit: [netbsd-2] src/bin/sh
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Jeff Rizzo <riz@netbsd.org>
List: netbsd-bugs
Date: 05/11/2005 23:17:01
The following reply was made to PR bin/28852; it has been noted by GNATS.

From: Jeff Rizzo <riz@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/28852 CVS commit: [netbsd-2] src/bin/sh
Date: Wed, 11 May 2005 23:16:10 +0000 (UTC)

 Module Name:	src
 Committed By:	riz
 Date:		Wed May 11 23:16:10 UTC 2005
 
 Modified Files:
 	src/bin/sh [netbsd-2]: expand.c
 
 Log Message:
 Pull up revision 1.68 (requested by martin in ticket #1418):
 expbackq() was incorrectly backing up a temporary buffer when removing \n
 from the end of output of commands inside $(...) substitutions.
 If the program output is n*128+1 bytes long (ending in a \n) then the code
 checks buf[-1] for another \n - looking an uninitialised stack.
 On a big-endian system an integer of value 10 will satisfy this (unlikely
 on little endian) and can happen depending on the last code path to use
 a lot of stack!
 This caused the problem with newvers.sh on sparc64 after ', 2005' was
 added to the date list.
 Fixed PR/28852
 
 
 To generate a diff of this commit:
 cvs rdiff -r1.60 -r1.60.4.1 src/bin/sh/expand.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.