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

From: Will Newton
Date: Wed Sep 22 2010 - 10:59:18 EST


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@xxxxxxxxxx>
---
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
From 56ba849e18805158ca10ca1b28db0504f24d9563 Mon Sep 17 00:00:00 2001
From: Will Newton <will.newton@xxxxxxxxxx>
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@xxxxxxxxxx>
---
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