diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-06-19 21:51:32 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-06-19 21:51:32 +0200 |
commit | 2072c642d1e2a3f20ef3656eab1f3703938a0859 (patch) | |
tree | 2021723ffe25eea7529d25fdffcc02c482dfe149 /contrib/epee | |
parent | Merge pull request #857 (diff) | |
parent | wallet_rpc_server: fix some string values being returned between <> (diff) | |
download | monero-2072c642d1e2a3f20ef3656eab1f3703938a0859.tar.xz |
Merge pull request #862
5dc09f2 wallet_rpc_server: fix some string values being returned between <> (moneromooo-monero)
f8213c0 Require 64/16 characters for payment ids (moneromooo-monero)
Diffstat (limited to 'contrib/epee')
-rw-r--r-- | contrib/epee/include/string_tools.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/epee/include/string_tools.h b/contrib/epee/include/string_tools.h index 8289ee0ba..b973c6d48 100644 --- a/contrib/epee/include/string_tools.h +++ b/contrib/epee/include/string_tools.h @@ -139,9 +139,11 @@ namespace string_tools } //---------------------------------------------------------------------------- template<class CharT> - bool parse_hexstr_to_binbuff(const std::basic_string<CharT>& s, std::basic_string<CharT>& res) + bool parse_hexstr_to_binbuff(const std::basic_string<CharT>& s, std::basic_string<CharT>& res, bool allow_partial_byte = false) { res.clear(); + if (!allow_partial_byte && (s.size() & 1)) + return false; try { long v = 0; |