The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] kconfig: Use PATH_MAX instead of 128 for path buffer sizes.
@ 2010-09-22 14:59 Will Newton
  2010-09-24  9:32 ` Américo Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Will Newton @ 2010-09-22 14:59 UTC (permalink / raw)
  To: Linux Kernel list; +Cc: Michal Marek, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 966 bytes --]

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>
---
 scripts/kconfig/confdata.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 515253f..9e2dda2 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -541,7 +541,7 @@ int conf_write(const char *name)
 	struct menu *menu;
 	const char *basename;
 	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;
 	time_t now;
 	int use_timestamp = 1;
@@ -662,7 +662,7 @@ next:
 static int conf_split_config(void)
 {
 	const char *name;
-	char path[128];
+	char path[PATH_MAX+1];
 	char *s, *d, c;
 	struct symbol *sym;
 	struct stat sb;
-- 
1.7.2.2

[-- Attachment #2: 0001-kconfig-Use-PATH_MAX-instead-of-128-for-path-buffer-.patch --]
[-- Type: text/x-patch, Size: 1197 bytes --]

From 56ba849e18805158ca10ca1b28db0504f24d9563 Mon Sep 17 00:00:00 2001
From: Will Newton <will.newton@imgtec.com>
Date: Wed, 22 Sep 2010 15:49:22 +0100
Subject: [PATCH] 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>
---
 scripts/kconfig/confdata.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 515253f..9e2dda2 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -541,7 +541,7 @@ int conf_write(const char *name)
 	struct menu *menu;
 	const char *basename;
 	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;
 	time_t now;
 	int use_timestamp = 1;
@@ -662,7 +662,7 @@ next:
 static int conf_split_config(void)
 {
 	const char *name;
-	char path[128];
+	char path[PATH_MAX+1];
 	char *s, *d, c;
 	struct symbol *sym;
 	struct stat sb;
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-10-04 13:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-22 14:59 [PATCH] kconfig: Use PATH_MAX instead of 128 for path buffer sizes Will Newton
2010-09-24  9:32 ` Américo Wang
2010-10-04 13:00   ` Will Newton
2010-10-04 13:41     ` Michal Marek
2010-10-04 13:46       ` Will Newton
2010-10-04 13:46       ` Will Newton
2010-10-04 13:47       ` Will Newton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox