瀏覽代碼

kconfig: Use PATH_MAX instead of 128 for path buffer sizes.

This prevents the buffers being overflowed when using a config
file with a long name. PATH_MAX is used elsewhere in the same
file, so use it here as well.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Will Newton 14 年之前
父節點
當前提交
1408b15b98
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scripts/kconfig/confdata.c

+ 2 - 2
scripts/kconfig/confdata.c

@@ -535,7 +535,7 @@ int conf_write(const char *name)
 	struct menu *menu;
 	struct menu *menu;
 	const char *basename;
 	const char *basename;
 	const char *str;
 	const char *str;
-	char dirname[128], tmpname[128], newname[128];
+	char dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1];
 	enum symbol_type type;
 	enum symbol_type type;
 	time_t now;
 	time_t now;
 	int use_timestamp = 1;
 	int use_timestamp = 1;
@@ -654,7 +654,7 @@ next:
 static int conf_split_config(void)
 static int conf_split_config(void)
 {
 {
 	const char *name;
 	const char *name;
-	char path[128];
+	char path[PATH_MAX+1];
 	char *s, *d, c;
 	char *s, *d, c;
 	struct symbol *sym;
 	struct symbol *sym;
 	struct stat sb;
 	struct stat sb;