@@ -679,11 +679,15 @@ class TokenCodec
679679 std::uint64_t pos = position ();
680680 const std::string result (m_buffer + pos, dataLength);
681681 position (position () + dataLength);
682- return std::move ( result) ;
682+ return result;
683683 }
684684
685685 TokenCodec &putName (const std::string& str)
686686 {
687+ if (str.length () > 65534 )
688+ {
689+ throw std::runtime_error (" std::string length too long for length type [E109]" );
690+ }
687691 std::uint64_t lengthOfLengthField = 2 ;
688692 std::uint64_t lengthPosition = position ();
689693 position (lengthPosition + lengthOfLengthField);
@@ -778,11 +782,15 @@ class TokenCodec
778782 std::uint64_t pos = position ();
779783 const std::string result (m_buffer + pos, dataLength);
780784 position (position () + dataLength);
781- return std::move ( result) ;
785+ return result;
782786 }
783787
784788 TokenCodec &putConstValue (const std::string& str)
785789 {
790+ if (str.length () > 65534 )
791+ {
792+ throw std::runtime_error (" std::string length too long for length type [E109]" );
793+ }
786794 std::uint64_t lengthOfLengthField = 2 ;
787795 std::uint64_t lengthPosition = position ();
788796 position (lengthPosition + lengthOfLengthField);
@@ -877,11 +885,15 @@ class TokenCodec
877885 std::uint64_t pos = position ();
878886 const std::string result (m_buffer + pos, dataLength);
879887 position (position () + dataLength);
880- return std::move ( result) ;
888+ return result;
881889 }
882890
883891 TokenCodec &putMinValue (const std::string& str)
884892 {
893+ if (str.length () > 65534 )
894+ {
895+ throw std::runtime_error (" std::string length too long for length type [E109]" );
896+ }
885897 std::uint64_t lengthOfLengthField = 2 ;
886898 std::uint64_t lengthPosition = position ();
887899 position (lengthPosition + lengthOfLengthField);
@@ -976,11 +988,15 @@ class TokenCodec
976988 std::uint64_t pos = position ();
977989 const std::string result (m_buffer + pos, dataLength);
978990 position (position () + dataLength);
979- return std::move ( result) ;
991+ return result;
980992 }
981993
982994 TokenCodec &putMaxValue (const std::string& str)
983995 {
996+ if (str.length () > 65534 )
997+ {
998+ throw std::runtime_error (" std::string length too long for length type [E109]" );
999+ }
9841000 std::uint64_t lengthOfLengthField = 2 ;
9851001 std::uint64_t lengthPosition = position ();
9861002 position (lengthPosition + lengthOfLengthField);
@@ -1075,11 +1091,15 @@ class TokenCodec
10751091 std::uint64_t pos = position ();
10761092 const std::string result (m_buffer + pos, dataLength);
10771093 position (position () + dataLength);
1078- return std::move ( result) ;
1094+ return result;
10791095 }
10801096
10811097 TokenCodec &putNullValue (const std::string& str)
10821098 {
1099+ if (str.length () > 65534 )
1100+ {
1101+ throw std::runtime_error (" std::string length too long for length type [E109]" );
1102+ }
10831103 std::uint64_t lengthOfLengthField = 2 ;
10841104 std::uint64_t lengthPosition = position ();
10851105 position (lengthPosition + lengthOfLengthField);
@@ -1174,11 +1194,15 @@ class TokenCodec
11741194 std::uint64_t pos = position ();
11751195 const std::string result (m_buffer + pos, dataLength);
11761196 position (position () + dataLength);
1177- return std::move ( result) ;
1197+ return result;
11781198 }
11791199
11801200 TokenCodec &putCharacterEncoding (const std::string& str)
11811201 {
1202+ if (str.length () > 65534 )
1203+ {
1204+ throw std::runtime_error (" std::string length too long for length type [E109]" );
1205+ }
11821206 std::uint64_t lengthOfLengthField = 2 ;
11831207 std::uint64_t lengthPosition = position ();
11841208 position (lengthPosition + lengthOfLengthField);
@@ -1273,11 +1297,15 @@ class TokenCodec
12731297 std::uint64_t pos = position ();
12741298 const std::string result (m_buffer + pos, dataLength);
12751299 position (position () + dataLength);
1276- return std::move ( result) ;
1300+ return result;
12771301 }
12781302
12791303 TokenCodec &putEpoch (const std::string& str)
12801304 {
1305+ if (str.length () > 65534 )
1306+ {
1307+ throw std::runtime_error (" std::string length too long for length type [E109]" );
1308+ }
12811309 std::uint64_t lengthOfLengthField = 2 ;
12821310 std::uint64_t lengthPosition = position ();
12831311 position (lengthPosition + lengthOfLengthField);
@@ -1372,11 +1400,15 @@ class TokenCodec
13721400 std::uint64_t pos = position ();
13731401 const std::string result (m_buffer + pos, dataLength);
13741402 position (position () + dataLength);
1375- return std::move ( result) ;
1403+ return result;
13761404 }
13771405
13781406 TokenCodec &putTimeUnit (const std::string& str)
13791407 {
1408+ if (str.length () > 65534 )
1409+ {
1410+ throw std::runtime_error (" std::string length too long for length type [E109]" );
1411+ }
13801412 std::uint64_t lengthOfLengthField = 2 ;
13811413 std::uint64_t lengthPosition = position ();
13821414 position (lengthPosition + lengthOfLengthField);
@@ -1471,11 +1503,15 @@ class TokenCodec
14711503 std::uint64_t pos = position ();
14721504 const std::string result (m_buffer + pos, dataLength);
14731505 position (position () + dataLength);
1474- return std::move ( result) ;
1506+ return result;
14751507 }
14761508
14771509 TokenCodec &putSemanticType (const std::string& str)
14781510 {
1511+ if (str.length () > 65534 )
1512+ {
1513+ throw std::runtime_error (" std::string length too long for length type [E109]" );
1514+ }
14791515 std::uint64_t lengthOfLengthField = 2 ;
14801516 std::uint64_t lengthPosition = position ();
14811517 position (lengthPosition + lengthOfLengthField);
@@ -1570,11 +1606,15 @@ class TokenCodec
15701606 std::uint64_t pos = position ();
15711607 const std::string result (m_buffer + pos, dataLength);
15721608 position (position () + dataLength);
1573- return std::move ( result) ;
1609+ return result;
15741610 }
15751611
15761612 TokenCodec &putDescription (const std::string& str)
15771613 {
1614+ if (str.length () > 65534 )
1615+ {
1616+ throw std::runtime_error (" std::string length too long for length type [E109]" );
1617+ }
15781618 std::uint64_t lengthOfLengthField = 2 ;
15791619 std::uint64_t lengthPosition = position ();
15801620 position (lengthPosition + lengthOfLengthField);
0 commit comments