From 022a7208868b886395d6ff48ec887b774d1f8849 Mon Sep 17 00:00:00 2001 From: Patrick Mchardy Date: Fri, 19 Nov 2010 20:13:32 +0100 Subject: dectmon: fix IPEI buffer size Need to account for the terminating '\0'. Signed-off-by: Patrick McHardy --- src/cmd-parser.y | 2 +- src/nwk.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd-parser.y b/src/cmd-parser.y index 0211371..59432a4 100644 --- a/src/cmd-parser.y +++ b/src/cmd-parser.y @@ -192,7 +192,7 @@ cluster_stmt : CLUSTER SHOW portable_stmt : PORTABLE SHOW { - char ipei[DECT_IPEI_STRING_LEN]; + char ipei[DECT_IPEI_STRING_LEN + 1]; struct dect_handle_priv *priv; struct dect_pt *pt; diff --git a/src/nwk.c b/src/nwk.c index 5569c00..267ee7f 100644 --- a/src/nwk.c +++ b/src/nwk.c @@ -82,7 +82,7 @@ static FILE *dect_keyfile_open(const char *mode) static void dect_pt_write_uak(const struct dect_pt *pt) { - char ipei[DECT_IPEI_STRING_LEN]; + char ipei[DECT_IPEI_STRING_LEN + 1]; unsigned int i; FILE *f; @@ -101,7 +101,7 @@ static void dect_pt_write_uak(const struct dect_pt *pt) static void dect_pt_read_uak(struct dect_pt *pt) { - char ipei[DECT_IPEI_STRING_LEN]; + char ipei[DECT_IPEI_STRING_LEN + 1]; uint8_t uak[DECT_AUTH_KEY_LEN]; struct dect_ipui ipui; unsigned int i; -- cgit v1.2.3