sh: Fix bss-based buffer overflow in . builtin.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 21 Aug 2011 19:27:39 +0000 (12:27 -0700)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 21 Aug 2011 20:49:09 +0000 (13:49 -0700)
commit332546d32a797c819b3a1804e66be73417674ff1
tree50e25ff2be7f4ff5b60212fd4bacdec4f5b7a6b1
parent088f2cdc6274ddce9e65245341b5ed3059305a5c
sh: Fix bss-based buffer overflow in . builtin.

If the length of a directory in PATH together with the given filename
exceeded FILENAME_MAX (which may happen even for pathnames that work), a
static buffer was overflown.

The static buffer is unnecessary, we can use the stalloc() stack.

Obtained-from:     FreeBSD 222173
bin/sh/main.c