aboutsummaryrefslogtreecommitdiff
path: root/src/httprpc.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2017-01-18 19:24:02 +0100
committerWladimir J. van der Laan <[email protected]>2017-01-18 20:05:30 +0100
commit6012967c4746095e6f66a142cb9f639544c17377 (patch)
tree3388f969b65a5f9c3388bde027b6c6c08b1af6c8 /src/httprpc.cpp
parentMerge #9508: Remove unused Python imports (diff)
parentAvoid boost dynamic_bitset in rest_getutxos (diff)
downloaddiscoin-6012967c4746095e6f66a142cb9f639544c17377.tar.xz
discoin-6012967c4746095e6f66a142cb9f639544c17377.zip
Merge #9512: Fix various things -fsanitize complains about
82e8baa Avoid boost dynamic_bitset in rest_getutxos (Pieter Wuille) 99f001e Fix memory leak in multiUserAuthorized (Pieter Wuille) 5a0b7e4 Fix memory leak in net_tests (Pieter Wuille) 6b03bfb Fix memory leak in wallet tests (Pieter Wuille) f94f3e0 Avoid integer overflows in scriptnum tests (Pieter Wuille) 843c560 Avoid unaligned access in crypto i/o (Pieter Wuille)
Diffstat (limited to 'src/httprpc.cpp')
-rw-r--r--src/httprpc.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/httprpc.cpp b/src/httprpc.cpp
index 742ff2b8f..93beda09a 100644
--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -113,8 +113,8 @@ static bool multiUserAuthorized(std::string strUserPass)
std::string strHash = vFields[2];
unsigned int KEY_SIZE = 32;
- unsigned char *out = new unsigned char[KEY_SIZE];
-
+ unsigned char out[KEY_SIZE];
+
CHMAC_SHA256(reinterpret_cast<const unsigned char*>(strSalt.c_str()), strSalt.size()).Write(reinterpret_cast<const unsigned char*>(strPass.c_str()), strPass.size()).Finalize(out);
std::vector<unsigned char> hexvec(out, out+KEY_SIZE);
std::string strHashFromPass = HexStr(hexvec);