fixed using raw non-null-terminated strings from config parser in syscalls

This commit is contained in:
Roman Arutyunyan 2013-11-28 17:14:39 +04:00
parent b73075e28c
commit 29dfda882a
2 changed files with 6 additions and 2 deletions

View file

@ -742,7 +742,9 @@ ngx_rtmp_ensure_directory(ngx_rtmp_session_t *s)
dacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_dash_module);
if (ngx_file_info(dacf->path.data, &fi) == NGX_FILE_ERROR) {
*ngx_snprintf(path, sizeof(path) - 1, "%V", &dacf->path) = 0;
if (ngx_file_info(path, &fi) == NGX_FILE_ERROR) {
if (ngx_errno != NGX_ENOENT) {
ngx_log_error(NGX_LOG_ERR, s->connection->log, ngx_errno,

View file

@ -313,7 +313,9 @@ ngx_rtmp_hls_create_parent_dir(ngx_rtmp_session_t *s)
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
"hls: creating target folder: '%V'", &hacf->path);
if (ngx_create_dir(hacf->path.data, NGX_RTMP_HLS_DIR_ACCESS) != NGX_OK) {
*ngx_snprintf(path, sizeof(path) - 1, "%V", &hacf->path) = 0;
if (ngx_create_dir(path, NGX_RTMP_HLS_DIR_ACCESS) != NGX_OK) {
err = ngx_errno;
if (err != NGX_EEXIST) {
ngx_log_error(NGX_LOG_ERR, s->connection->log, err,