aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2016-11-29 16:50:49 -0800
committerMatt Corallo <git@bluematt.me>2016-12-23 21:30:15 -0500
commit2b5f085ad11b4b354f48d77e66698fa386c8abbd (patch)
treec4271c5b5007958565d443d76829d8dbf5135981 /src/httpserver.cpp
parentc8042a48f01aaf306e108683e40db4bfaf0bbcaa (diff)
downloadbitcoin-2b5f085ad11b4b354f48d77e66698fa386c8abbd.tar.xz
Fix non-const mapMultiArgs[] access after init.
Swap mapMultiArgs for a const-reference to a _mapMultiArgs which is only accessed in util.cpp
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r--src/httpserver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index b296b28503..2d25168a16 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -204,7 +204,7 @@ static bool InitHTTPAllowList()
rpc_allow_subnets.push_back(CSubNet(localv4, 8)); // always allow IPv4 local subnet
rpc_allow_subnets.push_back(CSubNet(localv6)); // always allow IPv6 localhost
if (mapMultiArgs.count("-rpcallowip")) {
- const std::vector<std::string>& vAllow = mapMultiArgs["-rpcallowip"];
+ const std::vector<std::string>& vAllow = mapMultiArgs.at("-rpcallowip");
for (std::string strAllow : vAllow) {
CSubNet subnet;
LookupSubNet(strAllow.c_str(), subnet);
@@ -328,8 +328,8 @@ static bool HTTPBindAddresses(struct evhttp* http)
if (mapArgs.count("-rpcbind")) {
LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n");
}
- } else if (mapArgs.count("-rpcbind")) { // Specific bind address
- const std::vector<std::string>& vbind = mapMultiArgs["-rpcbind"];
+ } else if (mapMultiArgs.count("-rpcbind")) { // Specific bind address
+ const std::vector<std::string>& vbind = mapMultiArgs.at("-rpcbind");
for (std::vector<std::string>::const_iterator i = vbind.begin(); i != vbind.end(); ++i) {
int port = defaultPort;
std::string host;