summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Mchardy <kaber@t61.localnet>2010-11-19 20:13:32 +0100
committerPatrick Mchardy <kaber@t61.localnet>2010-11-19 20:13:32 +0100
commit022a7208868b886395d6ff48ec887b774d1f8849 (patch)
tree0df6740d30ddb9e52e3d0d14fa651b8f6a6d65cf
parenta222b17339c75f5bd0aca67033e28ec0586ba206 (diff)
dectmon: fix IPEI buffer size
Need to account for the terminating '\0'. Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r--src/cmd-parser.y2
-rw-r--r--src/nwk.c4
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;