]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs.c: the max length of debugfs argument is too short
authorRobert Yang <liezhi.yang@windriver.com>
Mon, 14 Oct 2013 02:07:57 +0000 (22:07 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Oct 2013 02:07:57 +0000 (22:07 -0400)
The max length of debugfs argument is 256 which is too short, the
arguments are two paths, the PATH_MAX is 4096 according to
/usr/include/linux/limits.h, so use BUFSIZ (which is 8192 on Linux
systems), that's also what the ss library uses.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c

index cf559df11c66a6ade3f4af2dcf6d22debe7ffa23..4f190259f2bde1a46c1338f50b8feb65d276900d 100644 (file)
@@ -37,6 +37,10 @@ extern char *optarg;
 #include "../version.h"
 #include "jfs_user.h"
 
+#ifndef BUFSIZ
+#define BUFSIZ 8192
+#endif
+
 ss_request_table *extra_cmds;
 const char *debug_prog_name;
 int sci_idx;
@@ -2293,7 +2297,7 @@ void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[])
 static int source_file(const char *cmd_file, int ss_idx)
 {
        FILE            *f;
-       char            buf[256];
+       char            buf[BUFSIZ];
        char            *cp;
        int             exit_status = 0;
        int             retval;