From fb97f596e13eb42e50bb8b52892830b18af92da5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 24 Aug 2018 23:08:15 +0900 Subject: [PATCH] nghttpx: Allocate mruby file because fopen requires NULL terminated string --- src/shrpx_config.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shrpx_config.cc b/src/shrpx_config.cc index e5d3b7ae..a00a3587 100644 --- a/src/shrpx_config.cc +++ b/src/shrpx_config.cc @@ -1057,7 +1057,7 @@ int parse_mapping(Config *config, DownstreamAddrConfig &addr, // least one backend with mruby file, it is used for all backend // in the group. if (g.mruby_file.empty()) { - g.mruby_file = params.mruby; + g.mruby_file = make_string_ref(downstreamconf.balloc, params.mruby); } else if (g.mruby_file != params.mruby) { LOG(ERROR) << "backend: mruby: multiple different mruby file found in " "a single group"; @@ -1084,7 +1084,7 @@ int parse_mapping(Config *config, DownstreamAddrConfig &addr, g.affinity.cookie.secure = params.affinity.cookie.secure; } g.redirect_if_not_tls = params.redirect_if_not_tls; - g.mruby_file = params.mruby; + g.mruby_file = make_string_ref(downstreamconf.balloc, params.mruby); if (pattern[0] == '*') { // wildcard pattern