[BusyBox] patch: util-linux/mount.c: long filenames in /etc/fstab

Erik Andersen andersen at codepoet.org
Sat Apr 13 07:51:03 UTC 2002


On Fri Mar 22, 2002 at 12:43:03PM -0800, Kevin Hilman wrote:
> This patch fixes a problem if there are long pathnames in /etc/fstab.
> 
> The 'device' buffer is xmalloc'd using PATH_MAX, but after
> simplify_path(), it nolonger points to the xmalloc'd region, instead,
> it's pointing to a strdup'd region.
> 
> This is fine until later on when this is done:
> 
> 			strcpy(device, m->mnt_fsname);
> 
> Which, if m->mnt_fsname is long enough, you get some nice memory
> corruption.

Sorry its taken me a while to get to this.  I've been swamped.
Good spotting, applied.  Thanks Kevin (long time no see).  

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the busybox mailing list