From: Eric Andersen Date: Sat, 13 Apr 2002 13:47:39 +0000 (-0000) Subject: Patch from Kevin Hilman to fix potential X-Git-Tag: 0_60_3~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=defd998c42d017fa94f80c4275ac082220c14c79;p=oweals%2Fbusybox.git Patch from Kevin Hilman to fix potential memory corruption from long pathnames in /etc/fstab. --- 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) 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); }