diff options
| -rw-r--r-- | src/supplemental/http/http_server.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c index aa397f00..49203a1c 100644 --- a/src/supplemental/http/http_server.c +++ b/src/supplemental/http/http_server.c @@ -1571,7 +1571,8 @@ http_handle_dir(nni_aio *aio) rv = 0; if (nni_file_is_dir(pn)) { - sprintf(dst, "%s%s", NNG_PLATFORM_DIR_SEP, "index.html"); + snprintf(dst, pnsz - strlen(pn), "%s%s", NNG_PLATFORM_DIR_SEP, + "index.html"); if (!nni_file_is_file(pn)) { pn[strlen(pn) - 1] = '\0'; // index.html -> index.htm if (!nni_file_is_file(pn)) { |
