File tree 1 file changed +2
-2
lines changed 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ static inline char* duplicateStringValue(const char* value,
86
86
size_t length) {
87
87
// Avoid an integer overflow in the call to malloc below by limiting length
88
88
// to a sane value.
89
- if (length >= ( size_t ) Value::maxInt)
89
+ if (length >= static_cast < size_t >( Value::maxInt) )
90
90
length = Value::maxInt - 1 ;
91
91
92
92
char * newString = static_cast <char *>(malloc (length + 1 ));
@@ -108,7 +108,7 @@ static inline char* duplicateAndPrefixStringValue(
108
108
{
109
109
// Avoid an integer overflow in the call to malloc below by limiting length
110
110
// to a sane value.
111
- JSON_ASSERT_MESSAGE (length <= ( unsigned ) Value::maxInt - sizeof (unsigned ) - 1U ,
111
+ JSON_ASSERT_MESSAGE (length <= static_cast < unsigned >( Value::maxInt) - sizeof (unsigned ) - 1U ,
112
112
" in Json::Value::duplicateAndPrefixStringValue(): "
113
113
" length too big for prefixing" );
114
114
unsigned actualLength = length + static_cast <unsigned >(sizeof (unsigned )) + 1U ;
You can’t perform that action at this time.
0 commit comments