From: Robert Yang Date: Mon, 14 Oct 2013 02:07:57 +0000 (-0400) Subject: debugfs.c: the max length of debugfs argument is too short X-Git-Tag: v1.42.9~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=355ffb2ff566229b8bc3f5f7557e91edff5a767a;p=thirdparty%2Fe2fsprogs.git debugfs.c: the max length of debugfs argument is too short 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 Acked-by: Darren Hart Signed-off-by: Theodore Ts'o --- diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index cf559df11..4f190259f 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -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;