File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -850,8 +850,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) {
850
850
// We check the the payload in token_start_internal_value_ against
851
851
// that range (2^31-1 is also known as
852
852
// std::numeric_limits<int32_t>::max()).
853
- if (!bytes_read || token_start_internal_value_ >
854
- std::numeric_limits<int32_t >::max ()) {
853
+ if (!bytes_read ||
854
+ static_cast <int64_t >(token_start_internal_value_) >
855
+ static_cast <int64_t >(std::numeric_limits<int32_t >::max ())) {
855
856
SetError (Error::CBOR_INVALID_INT32);
856
857
return ;
857
858
}
Original file line number Diff line number Diff line change @@ -858,8 +858,9 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) {
858
858
// We check the the payload in token_start_internal_value_ against
859
859
// that range (2^31-1 is also known as
860
860
// std::numeric_limits<int32_t>::max()).
861
- if (!bytes_read || token_start_internal_value_ >
862
- std::numeric_limits<int32_t>::max()) {
861
+ if (!bytes_read ||
862
+ static_cast<int64_t>(token_start_internal_value_) >
863
+ static_cast<int64_t>(std::numeric_limits<int32_t>::max())) {
863
864
SetError(Error::CBOR_INVALID_INT32);
864
865
return;
865
866
}
You can’t perform that action at this time.
0 commit comments