fix html page

This commit is contained in:
benchea dan 2023-03-16 10:55:30 +02:00 committed by GitHub
parent 9ad2e330ad
commit 2e205e76a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,7 +174,8 @@ static char *ngx_http_js_challenge_merge_loc_conf(ngx_conf_t *cf, void *parent,
} }
conf->html = ngx_palloc(cf->pool, info.st_size); conf->html = ngx_palloc(cf->pool, info.st_size);
int ret = read(fd, conf->html, info.st_size); memset(conf->html,'\0',info.st_size);
int ret = read(fd, conf->html, info.st_size-1);
close(fd); close(fd);
if (ret < 0) { if (ret < 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "js_challenge_html: Could not read file '%s': %s", path, ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "js_challenge_html: Could not read file '%s': %s", path,