From 21a7bae2f1ba1cf2c57567a3226dee5cc5effdac Mon Sep 17 00:00:00 2001 From: Isidoro Ghezzi Date: Fri, 4 Sep 2015 19:24:12 +0200 Subject: [PATCH] avoid undefined behaviour TODO: use boost::lexical_cast or C++11 std::to_string --- src/libbitcoind.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libbitcoind.cc b/src/libbitcoind.cc index bb866707..9212206f 100644 --- a/src/libbitcoind.cc +++ b/src/libbitcoind.cc @@ -1448,7 +1448,8 @@ NAN_METHOD(SendTransaction) { // Attempt to add the transaction to the mempool if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, !allowAbsurdFees)) { if (state.IsInvalid()) { - char *errorMessage; + // TODO: use boost::lexical_cast or C++11 std::to_string + char errorMessage [1024]; sprintf(errorMessage, "%i: %s", state.GetRejectCode(), state.GetRejectReason().c_str()); return NanThrowError(errorMessage); } else {