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.
This commit is contained in:
Valentin Bartenev
2020-05-20 11:18:03 +03:00
parent 140b81208e
commit b2e6ef7beb

View File

@@ -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);
}