diff options
| author | practicalswift <[email protected]> | 2019-12-11 16:39:29 +0000 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2020-01-08 12:35:59 +0000 |
| commit | 9574de86ad703ad942cdd0eca79f48c0d42b102b (patch) | |
| tree | 54955eedefb9824d094f9e1e9d199274a6d3a7ec /src/httpserver.cpp | |
| parent | Merge #17452: test: update fuzz directory in .gitignore (diff) | |
| download | discoin-9574de86ad703ad942cdd0eca79f48c0d42b102b.tar.xz discoin-9574de86ad703ad942cdd0eca79f48c0d42b102b.zip | |
net: Avoid using C-style NUL-terminated strings as arguments in the netbase interface
Diffstat (limited to 'src/httpserver.cpp')
| -rw-r--r-- | src/httpserver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 7179949ea..0e13b8580 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -172,7 +172,7 @@ static bool InitHTTPAllowList() rpc_allow_subnets.push_back(CSubNet(localv6)); // always allow IPv6 localhost for (const std::string& strAllow : gArgs.GetArgs("-rpcallowip")) { CSubNet subnet; - LookupSubNet(strAllow.c_str(), subnet); + LookupSubNet(strAllow, subnet); if (!subnet.IsValid()) { uiInterface.ThreadSafeMessageBox( strprintf("Invalid -rpcallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).", strAllow), @@ -324,7 +324,7 @@ static bool HTTPBindAddresses(struct evhttp* http) evhttp_bound_socket *bind_handle = evhttp_bind_socket_with_handle(http, i->first.empty() ? nullptr : i->first.c_str(), i->second); if (bind_handle) { CNetAddr addr; - if (i->first.empty() || (LookupHost(i->first.c_str(), addr, false) && addr.IsBindAny())) { + if (i->first.empty() || (LookupHost(i->first, addr, false) && addr.IsBindAny())) { LogPrintf("WARNING: the RPC server is not safe to expose to untrusted networks such as the public internet\n"); } boundSockets.push_back(bind_handle); |