From 498b5056229d29f94d392d105a8f00e59978b6a6 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 4 Apr 2012 02:27:06 +0400 Subject: [PATCH] fxed crash on NULL arg in netcall --- ngx_rtmp_netcall_module.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ngx_rtmp_netcall_module.c b/ngx_rtmp_netcall_module.c index 061562c..119e748 100644 --- a/ngx_rtmp_netcall_module.c +++ b/ngx_rtmp_netcall_module.c @@ -193,11 +193,13 @@ ngx_rtmp_netcall_create(ngx_rtmp_session_t *s, ngx_rtmp_netcall_init_t *ci) } /* copy arg to connection pool */ - cs->arg = ngx_pcalloc(pool, ci->argsize); - if (cs->arg == NULL) { - goto error; + if (ci->argsize) { + cs->arg = ngx_pcalloc(pool, ci->argsize); + if (cs->arg == NULL) { + goto error; + } + ngx_memcpy(cs->arg, ci->arg, ci->argsize); } - ngx_memcpy(cs->arg, ci->arg, ci->argsize); cs->url = ci->url; cs->session = s;