From 376c3433c0ae67b9124fd91db2396de937b30e51 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 11 Jul 2017 11:29:11 -0700 Subject: [PATCH] tools: Fix wrong string buffer sizes --- tools/csr.c | 2 +- tools/hciattach_st.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/csr.c b/tools/csr.c index 15ae7c4fb..9408fb669 100644 --- a/tools/csr.c +++ b/tools/csr.c @@ -567,7 +567,7 @@ char *csr_buildidtostr(uint16_t id) if (csr_map[i].id == id) return csr_map[i].str; - snprintf(str, 11, "Build %d", id); + snprintf(str, sizeof(str), "Build %d", id); return str; } diff --git a/tools/hciattach_st.c b/tools/hciattach_st.c index 474545a75..85a2e0898 100644 --- a/tools/hciattach_st.c +++ b/tools/hciattach_st.c @@ -120,7 +120,7 @@ static int load_file(int dd, uint16_t version, const char *suffix) { DIR *dir; struct dirent *d; - char pathname[PATH_MAX], filename[NAME_MAX], prefix[20]; + char pathname[PATH_MAX], filename[NAME_MAX + 2], prefix[20]; unsigned char cmd[256]; unsigned char buf[256]; uint8_t seqnum = 0; -- 2.47.3