Subject: CVS commit: [netbsd-2-0] src/bin/sh
To: None <source-changes@NetBSD.org>
From: Jeff Rizzo <email@example.com>
Date: 10/28/2005 22:52:23
Module Name: src
Committed By: riz
Date: Fri Oct 28 22:52:23 UTC 2005
src/bin/sh [netbsd-2-0]: expand.c
Pull up following revision(s) (requested by martin in ticket #1418):
bin/sh/expand.c: revision 1.68
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.
To generate a diff of this commit:
cvs rdiff -r1.60 -r220.127.116.11 src/bin/sh/expand.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.