diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-04-13 13:47:39 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-04-13 13:47:39 +0000 |
commit | defd998c42d017fa94f80c4275ac082220c14c79 (patch) | |
tree | 3f68c9729d82ac42e07543600ecd2b0103533fe4 /util-linux | |
parent | 1f30a41abe3ad19cbd4e0bb6b67d4084ec576d20 (diff) | |
download | busybox-w32-defd998c42d017fa94f80c4275ac082220c14c79.tar.gz busybox-w32-defd998c42d017fa94f80c4275ac082220c14c79.tar.bz2 busybox-w32-defd998c42d017fa94f80c4275ac082220c14c79.zip |
Patch from Kevin Hilman <khilman@equator.com> to fix potential
memory corruption from long pathnames in /etc/fstab.
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/mount.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index 382ad832f..79335669d 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -425,7 +425,8 @@ extern int mount_main(int argc, char **argv) | |||
425 | if (optind < argc) { | 425 | if (optind < argc) { |
426 | /* if device is a filename get its real path */ | 426 | /* if device is a filename get its real path */ |
427 | if (stat(argv[optind], &statbuf) == 0) { | 427 | if (stat(argv[optind], &statbuf) == 0) { |
428 | device = simplify_path(argv[optind]); | 428 | char *tmp = simplify_path(argv[optind]); |
429 | safe_strncpy(device, tmp, PATH_MAX); | ||
429 | } else { | 430 | } else { |
430 | safe_strncpy(device, argv[optind], PATH_MAX); | 431 | safe_strncpy(device, argv[optind], PATH_MAX); |
431 | } | 432 | } |