]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r211155: sh: Fix heap-based buffer overflow in pathname generation.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 21 Aug 2010 20:48:09 +0000 (20:48 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 21 Aug 2010 20:48:09 +0000 (20:48 +0000)
commitd1302ab018a62dc117e4afb71d895a7502cab783
tree476edbf2fa3ede9d17c131a6bcd82119fa279cc3
parenta882327cc2b6b68dc46e2ae439080a58168d95d3
MFC r211155: sh: Fix heap-based buffer overflow in pathname generation.

The buffer for generated pathnames could be too small in some cases. It
happened to be always at least PATH_MAX long, so there was never an overflow
if the resulting pathnames would be usable.

This bug may be abused if a script subjects input from an untrusted source
to pathname generation, which a bad idea anyhow. Most shell scripts do not
work on untrusted data. secteam@ says no advisory is necessary.

PR: bin/148733
Reported by: Changming Sun snnn119 at gmail com

git-svn-id: svn://svn.freebsd.org/base/stable/8@211592 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/sh/expand.c
tools/regression/bin/sh/expansion/pathname3.0 [new file with mode: 0644]