diff options
author | Valentin Bartenev <vbart@nginx.com> | 2020-05-20 11:18:03 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2020-05-20 11:18:03 +0300 |
commit | b2e6ef7bebff632fc64e10bdb03b5da02817d172 (patch) | |
tree | 6c22552bdb3eaf150587ebf0695514b4c2c461d5 | |
parent | 140b81208e83569913aa81f964eb64e15940d897 (diff) | |
download | unit-b2e6ef7bebff632fc64e10bdb03b5da02817d172.tar.gz unit-b2e6ef7bebff632fc64e10bdb03b5da02817d172.tar.bz2 |
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.
-rw-r--r-- | src/nxt_http_static.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |