summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank K├╝hndel <frank.kuehndel@embedded-brains.de>2020-10-06 15:01:31 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-10-10 15:05:41 +0200
commitc8c1426c682325586e20c763dee3ec71c9ca4bff (patch)
tree455cb3ebe8264124969f38637812d4fe43254fcf
parentbc7ac71f8aaaff0c73469246c526741ec5b181ed (diff)
mghttpd/mongoose: Fix string truncation warning
This fixes the compiler warning below. ../../../cpukit/mghttpd/mongoose.c:1919:45: warning: '.gz' directive output may be truncated writing 3 bytes into a region of size between 1 and 255 [-Wformat-truncation=]
-rw-r--r--cpukit/mghttpd/mongoose.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/mghttpd/mongoose.c b/cpukit/mghttpd/mongoose.c
index fb2bce7471..0736c836ec 100644
--- a/cpukit/mghttpd/mongoose.c
+++ b/cpukit/mghttpd/mongoose.c
@@ -1887,7 +1887,7 @@ static void convert_uri_to_file_name(struct mg_connection *conn, char *buf,
*root = conn->ctx->config[DOCUMENT_ROOT];
char *p;
int match_len;
- char gz_path[PATH_MAX];
+ char gz_path[PATH_MAX + 3];
char const* accept_encoding;
// Using buf_len - 1 because memmove() for PATH_INFO may shift part
@@ -3021,7 +3021,7 @@ static void handle_file_request(struct mg_connection *conn, const char *path,
int64_t cl, r1, r2;
struct vec mime_vec;
int n;
- char gz_path[PATH_MAX];
+ char gz_path[PATH_MAX + 3];
char const* encoding = "";
get_mime_type(conn->ctx, path, &mime_vec);