From a012025deb7e42703a2caa54021dafdebc84b6c6 Mon Sep 17 00:00:00 2001 From: Anurag Kar Date: Mon, 10 Jun 2019 18:02:45 +0530 Subject: [PATCH] Example restful_server : Minor fix in copying file system base path --- .../protocols/http_server/restful_server/main/rest_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/protocols/http_server/restful_server/main/rest_server.c b/examples/protocols/http_server/restful_server/main/rest_server.c index 8c74ccec5..d68bd0a0a 100644 --- a/examples/protocols/http_server/restful_server/main/rest_server.c +++ b/examples/protocols/http_server/restful_server/main/rest_server.c @@ -172,7 +172,7 @@ esp_err_t start_rest_server(const char *base_path) REST_CHECK(base_path, "wrong base path", err); rest_server_context_t *rest_context = calloc(1, sizeof(rest_server_context_t)); REST_CHECK(rest_context, "No memory for rest context", err); - strncpy(rest_context->base_path, base_path, ESP_VFS_PATH_MAX); + strlcpy(rest_context->base_path, base_path, sizeof(rest_context->base_path)); httpd_handle_t server = NULL; httpd_config_t config = HTTPD_DEFAULT_CONFIG();