From b2e6ef7bebff632fc64e10bdb03b5da02817d172 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Wed, 20 May 2020 11:18:03 +0300 Subject: [PATCH] Static: fixed potential undefined behavior in memcpy(). According to the C standard, pointer arguments passed to memcpy() calls shall still have valid values. NULL is considered as invalid. Found with GCC Static Analyzer. --- src/nxt_http_static.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c index 46ae57a7..ee18be1b 100644 --- a/src/nxt_http_static.c +++ b/src/nxt_http_static.c @@ -76,7 +76,7 @@ nxt_http_static_handler(nxt_task_t *task, nxt_http_request_t *r, nxt_str_set(&extension, ".html"); } else { - nxt_str_null(&index); + nxt_str_set(&index, ""); nxt_str_null(&extension); }