Skip to content

Commit

Permalink
Fixed a bug that allowed prhibited unicode values
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiruvalluvan M G committed Apr 2, 2024
1 parent e48ddad commit a47a5ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lang/c++/impl/json/JsonIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ string JsonParser::decodeString(const string &s, bool binary) {
% string(startSeq, it));
}
n = 0x10000 + (((n - 0xd800) << 10) | (m - 0xdc00));
} else if (n >= 0xdc00 && n < 0xdfff) {
throw Exception(boost::format(
"Invalid unicode sequence: %1%")
% string(startSeq, it));
}
if (n < 0x80) {
result.push_back(n);
Expand Down

0 comments on commit a47a5ce

Please sign in to comment.