aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/readlink.c4
-rw-r--r--util-linux/umount.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/coreutils/readlink.c b/coreutils/readlink.c
index b6e389a21..1ab94595a 100644
--- a/coreutils/readlink.c
+++ b/coreutils/readlink.c
@@ -8,7 +8,6 @@
8 */ 8 */
9 9
10#include <getopt.h> 10#include <getopt.h>
11
12#include "libbb.h" 11#include "libbb.h"
13 12
14int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 13int readlink_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -16,6 +15,7 @@ int readlink_main(int argc, char **argv)
16{ 15{
17 char *buf; 16 char *buf;
18 char *fname; 17 char *fname;
18 char pathbuf[PATH_MAX];
19 19
20 USE_FEATURE_READLINK_FOLLOW( 20 USE_FEATURE_READLINK_FOLLOW(
21 unsigned opt; 21 unsigned opt;
@@ -34,7 +34,7 @@ int readlink_main(int argc, char **argv)
34 logmode = LOGMODE_NONE; 34 logmode = LOGMODE_NONE;
35 35
36 if (opt) { 36 if (opt) {
37 buf = realpath(fname, bb_common_bufsiz1); 37 buf = realpath(fname, pathbuf);
38 } else { 38 } else {
39 buf = xmalloc_readlink_or_warn(fname); 39 buf = xmalloc_readlink_or_warn(fname);
40 } 40 }
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 17d88b388..7c1b81347 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -25,7 +25,7 @@ int umount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
25int umount_main(int argc, char **argv) 25int umount_main(int argc, char **argv)
26{ 26{
27 int doForce; 27 int doForce;
28 char path[2*PATH_MAX]; 28 char path[PATH_MAX + 2];
29 struct mntent me; 29 struct mntent me;
30 FILE *fp; 30 FILE *fp;
31 char *fstype = 0; 31 char *fstype = 0;
@@ -89,7 +89,7 @@ int umount_main(int argc, char **argv)
89 89
90 // Do we already know what to umount this time through the loop? 90 // Do we already know what to umount this time through the loop?
91 if (m) 91 if (m)
92 safe_strncpy(path, m->dir, PATH_MAX); 92 safe_strncpy(path, m->dir, sizeof(path));
93 // For umount -a, end of mtab means time to exit. 93 // For umount -a, end of mtab means time to exit.
94 else if (opt & OPT_ALL) 94 else if (opt & OPT_ALL)
95 break; 95 break;