mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-19 09:41:07 +02:00
added path checks
This commit is contained in:
parent
dea898a6ea
commit
219de8eded
|
@ -301,6 +301,7 @@ ngx_rtmp_record_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
|
|||
{
|
||||
ngx_rtmp_record_app_conf_t *racf;
|
||||
ngx_rtmp_record_ctx_t *ctx;
|
||||
u_char *p;
|
||||
|
||||
racf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_record_module);
|
||||
|
||||
|
@ -323,6 +324,17 @@ ngx_rtmp_record_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
|
|||
ngx_memcpy(ctx->name, v->name, sizeof(ctx->name));
|
||||
ngx_memcpy(ctx->args, v->args, sizeof(ctx->args));
|
||||
|
||||
/* terminate name on /../ */
|
||||
for (p = ctx->name; *p; ++p) {
|
||||
if (ngx_path_separator(p[0]) &&
|
||||
p[1] == '.' && p[2] == '.' &&
|
||||
ngx_path_separator(p[3]))
|
||||
{
|
||||
*p = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ngx_rtmp_record_open(s) != NGX_OK) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue