aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-06-19 21:51:32 +0200
committerRiccardo Spagni <ric@spagni.net>2016-06-19 21:51:32 +0200
commit2072c642d1e2a3f20ef3656eab1f3703938a0859 (patch)
tree2021723ffe25eea7529d25fdffcc02c482dfe149 /contrib
parentMerge pull request #857 (diff)
parentwallet_rpc_server: fix some string values being returned between <> (diff)
downloadmonero-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')
-rw-r--r--contrib/epee/include/string_tools.h4
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;