From ae5f6c0920be6e99a4959465f5ff8a821568483a Mon Sep 17 00:00:00 2001 From: cpq Date: Wed, 10 Feb 2021 11:09:13 +0000 Subject: [PATCH] Increase conn label size 32 -> 50 --- mongoose.c | 2 ++ mongoose.h | 2 +- src/net.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index 3d3395bb..d856b4e8 100644 --- a/mongoose.c +++ b/mongoose.c @@ -579,6 +579,8 @@ int mg_http_parse(const char *s, size_t len, struct mg_http_message *hm) { s = skip(s, end, " ", &hm->method); s = skip(s, end, " ", &hm->uri); s = skip(s, end, "\r\n", &hm->proto); + + // Sanity check if (hm->method.len == 0 || hm->uri.len == 0 || hm->proto.len == 0) return -1; // If URI contains '?' character, setup query string diff --git a/mongoose.h b/mongoose.h index 970aa56f..20fa10e1 100644 --- a/mongoose.h +++ b/mongoose.h @@ -643,7 +643,7 @@ struct mg_connection { void *fn_data; // User-speficied function parameter mg_event_handler_t pfn; // Protocol-specific handler function void *pfn_data; // Protocol-specific function parameter - char label[32]; // Arbitrary label + char label[50]; // Arbitrary label void *tls; // TLS specific data unsigned is_listening : 1; // Listening connection unsigned is_client : 1; // Outbound (client) connection diff --git a/src/net.h b/src/net.h index 24e1c6b9..6f216699 100644 --- a/src/net.h +++ b/src/net.h @@ -40,7 +40,7 @@ struct mg_connection { void *fn_data; // User-speficied function parameter mg_event_handler_t pfn; // Protocol-specific handler function void *pfn_data; // Protocol-specific function parameter - char label[32]; // Arbitrary label + char label[50]; // Arbitrary label void *tls; // TLS specific data unsigned is_listening : 1; // Listening connection unsigned is_client : 1; // Outbound (client) connection