From 9f46f49bc60c0ec1efa18e8c70d890e4b1f7f683 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 10 Aug 2017 11:46:17 -0400 Subject: [PATCH] throw error on name overflow #149 --- libraries/types/include/eos/types/native.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/types/include/eos/types/native.hpp b/libraries/types/include/eos/types/native.hpp index b70a4de10bc..c64e13371dc 100644 --- a/libraries/types/include/eos/types/native.hpp +++ b/libraries/types/include/eos/types/native.hpp @@ -105,11 +105,10 @@ namespace eos { namespace types { const auto len = strnlen(str,14); FC_ASSERT( len <= 13 ); value = string_to_name(str); + FC_ASSERT( toString() == String(str), "name not properly normalized", ("name",String(str))("normalized",toString()) ); }FC_CAPTURE_AND_RETHROW( (str) ) } - Name( uint64_t v = 0 ):value(v){ - // FC_ASSERT( !(v>>(5*12)), "invalid name id" ); - } + Name( uint64_t v = 0 ):value(v){} explicit operator String()const { static const char* charmap = ".abcdefghijklmnopqrstuvwxyz12345";