summaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
authorEric Andersen2002-04-13 13:47:39 +0000
committerEric Andersen2002-04-13 13:47:39 +0000
commitdefd998c42d017fa94f80c4275ac082220c14c79 (patch)
tree3f68c9729d82ac42e07543600ecd2b0103533fe4 /util-linux/mount.c
parent1f30a41abe3ad19cbd4e0bb6b67d4084ec576d20 (diff)
downloadbusybox-defd998c42d017fa94f80c4275ac082220c14c79.zip
busybox-defd998c42d017fa94f80c4275ac082220c14c79.tar.gz
Patch from Kevin Hilman <khilman@equator.com> to fix potential
memory corruption from long pathnames in /etc/fstab.
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 382ad83..7933566 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -425,7 +425,8 @@ extern int mount_main(int argc, char **argv)
if (optind < argc) {
/* if device is a filename get its real path */
if (stat(argv[optind], &statbuf) == 0) {
- device = simplify_path(argv[optind]);
+ char *tmp = simplify_path(argv[optind]);
+ safe_strncpy(device, tmp, PATH_MAX);
} else {
safe_strncpy(device, argv[optind], PATH_MAX);
}