Skip to content

Commit

Permalink
fix: remove fileGet in subexport.cpp for security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lonelam committed Sep 14, 2024
1 parent 9222e76 commit 7bbe8b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/build.windows.release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cmake -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD
make install -j4
cd ..

git clone https://github.com/ToruNiina/toml11 --depth=1
git clone https://github.com/ToruNiina/toml11 --branch v3.8.1 --depth=1
cd toml11
cmake -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" -DCMAKE_CXX_STANDARD=11 .
make install -j4
Expand Down
8 changes: 4 additions & 4 deletions src/generator/config/subexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ void proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGr
if (!x.Alpn.empty())
singleproxy["alpn"] = x.Alpn;
if (!x.Ca.empty())
singleproxy["ca-str"] = fileGet(x.Ca);
singleproxy["ca"] = x.Ca;
if (!x.CaStr.empty())
singleproxy["ca-str"] = x.CaStr;
if (x.RecvWindowConn)
Expand Down Expand Up @@ -547,7 +547,7 @@ void proxyToClash(std::vector<Proxy> &nodes, YAML::Node &yamlnode, const ProxyGr
if (!x.Alpn.empty())
singleproxy["alpn"] = x.Alpn;
if (!x.Ca.empty())
singleproxy["ca-str"] = fileGet(x.Ca);
singleproxy["ca"] = x.Ca;
if (!x.CaStr.empty())
singleproxy["ca-str"] = x.CaStr;
if (x.CWND)
Expand Down Expand Up @@ -2370,7 +2370,7 @@ void proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::v
if (!x.Ca.empty())
{
rapidjson::Value ca_str;
ca_str.SetString(fileGet(x.Ca).c_str(), allocator);
ca_str.SetString(x.Ca.c_str(), allocator);
tls.AddMember("certificate", ca_str, allocator);
}
if (!x.CaStr.empty())
Expand Down Expand Up @@ -2409,7 +2409,7 @@ void proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::v
if (!x.Ca.empty())
{
rapidjson::Value ca_str(rapidjson::kStringType);
ca_str.SetString(fileGet(x.Ca).c_str(), allocator);
ca_str.SetString(x.Ca.c_str(), allocator);
tls.AddMember("certificate", ca_str, allocator);
}
if (!x.CaStr.empty())
Expand Down

0 comments on commit 7bbe8b9

Please sign in to comment.