Date: Wed, 13 Oct 2010 23:29:09 +0000 (UTC) From: "David E. O'Brien" <obrien@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/bin/sh histedit.c memalloc.c memalloc.h src/tools/regression/bin/sh/expansion trim4.0 Message-ID: <201010132329.o9DNTqHK045424@repoman.freebsd.org>
index | next in thread | raw e-mail
obrien 2010-10-13 23:29:09 UTC
FreeBSD src repository
Modified files:
bin/sh histedit.c memalloc.c memalloc.h
Added files:
tools/regression/bin/sh/expansion trim4.0
Log:
SVN rev 213814 on 2010-10-13 23:29:09Z by obrien
Do not assume in growstackstr() that a "precious" character will be
immediately written into the stack after the call. Instead let the caller
manage the "space left".
Previously, growstackstr()'s assumption causes problems with STACKSTRNUL()
where we want to be able to turn a stack into a C string, and later
pretend the NUL is not there.
This fixes a bug in STACKSTRNUL() (that grew the stack) where:
1. STADJUST() called after a STACKSTRNUL() results in an improper adjust.
This can be seen in ${var%pattern} and ${var%%pattern} evaluation.
2. Memory leak in STPUTC() called after a STACKSTRNUL().
Reviewed by: jilles
Revision Changes Path
1.39 +1 -1 src/bin/sh/histedit.c
1.32 +10 -7 src/bin/sh/memalloc.c
1.13 +8 -1 src/bin/sh/memalloc.h
1.1 +15 -0 src/tools/regression/bin/sh/expansion/trim4.0 (new)
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010132329.o9DNTqHK045424>
