diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2018-12-02 00:50:33 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2018-12-02 00:52:11 -0500 |
commit | 685f4ed62c45aac8196166cf8b5f32f5a8416cb5 (patch) | |
tree | c81d66de180f4572ff32d94e61e47110858e1157 | |
parent | 53c231a764ef99085cb2a9475e64220a170d95de (diff) | |
download | lighttpd-git-685f4ed62c45aac8196166cf8b5f32f5a8416cb5.tar.gz |
[mod_cml,mod_flv_streaming] fix NULL ptr deref
fix possible NULL pointer dereference when query string not present
and no previous query strings processed by that specific connection
instance
regression in lighttpd 1.4.51 (mod_flv_streaming)
regression in lighttpd 1.4.52 (mod_cml)
workaround for mod_flv_streaming:
url.rewrite-once = ( "\.flv$" => "${url.path}?" )
(similar workaround for mod_cml)
(thx fab)
x-ref:
"segfault with mod_flv_streaming"
https://redmine.lighttpd.net/boards/2/topics/8404
-rw-r--r-- | src/mod_cml_lua.c | 1 | ||||
-rw-r--r-- | src/mod_flv_streaming.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/mod_cml_lua.c b/src/mod_cml_lua.c index daf15917..41b55436 100644 --- a/src/mod_cml_lua.c +++ b/src/mod_cml_lua.c @@ -67,6 +67,7 @@ static int cache_export_get_params(lua_State *L, int tbl, buffer *qrystr) { size_t i, len, klen = 0; char *key = NULL, *val = NULL; + if (buffer_string_is_empty(qrystr)) return 0; key = qrystr->ptr; /* we need the \0 */ diff --git a/src/mod_flv_streaming.c b/src/mod_flv_streaming.c index 90d980a4..cb6186f6 100644 --- a/src/mod_flv_streaming.c +++ b/src/mod_flv_streaming.c @@ -121,6 +121,7 @@ static int split_get_params(array *get_params, buffer *qrystr) { size_t is_key = 1, klen = 0; char *key = qrystr->ptr, *val = NULL; + if (buffer_string_is_empty(qrystr)) return 0; for (size_t i = 0, len = buffer_string_length(qrystr); i <= len; ++i) { switch(qrystr->ptr[i]) { case '=': |