From 7bf3eebb98488aeb1a5fd38a516c1c41f864f1fd Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Tue, 5 Oct 2021 19:35:09 +0200 Subject: update maximum uri length to 255 chars file with a large name might easily reach the existing 32 chars limit. --- src/handler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/handler.c b/src/handler.c index 2b9c6a0..f689c6e 100644 --- a/src/handler.c +++ b/src/handler.c @@ -59,7 +59,7 @@ int tip_client_state_process_payload(struct tip_client *cli) { const char *trailer, *x_redirect; bool allow_redirect = true; - char _uri[32], *uri = _uri; + char _uri[256], *uri = _uri; char allow_redirect_str[5]; char path[PATH_MAX + 1]; char *chunk = NULL; @@ -72,15 +72,15 @@ int tip_client_state_process_payload(struct tip_client *cli) if (!strncmp(cli->buf, "GET", strlen("GET"))) { cli->method = TIP_METHOD_GET; - if (sscanf(cli->buf, "GET %31s HTTP/1.1", uri) != 1) + if (sscanf(cli->buf, "GET %255s HTTP/1.1", uri) != 1) return tip_client_method_not_found(cli); } else if (!strncmp(cli->buf, "HEAD", strlen("HEAD"))) { cli->method = TIP_METHOD_HEAD; - if (sscanf(cli->buf, "HEAD %31s HTTP/1.1", uri) != 1) + if (sscanf(cli->buf, "HEAD %255s HTTP/1.1", uri) != 1) return tip_client_method_not_found(cli); } else if (!strncmp(cli->buf, "POST", strlen("POST"))) { cli->method = TIP_METHOD_POST; - if (sscanf(cli->buf, "POST %31s HTTP/1.1", uri) != 1) + if (sscanf(cli->buf, "POST %255s HTTP/1.1", uri) != 1) return tip_client_method_not_found(cli); } else { return tip_client_method_not_found(cli); -- cgit v1.2.3-18-g5258