mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
tools: update inspector_protocol to fe0467fd105a
Refs: https://chromium.googlesource.com/deps/inspector_protocol/+log PR-URL: https://github.com/nodejs/node/pull/39694 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
602fe4e83a
commit
c3df329889
1 file changed
+11
-10
@@ -850,14 +850,15 @@ void CBORTokenizer::ReadNextToken(bool enter_envelope) {
|
||||
return;
|
||||
case MajorType::NEGATIVE: { // INT32.
|
||||
// INT32 is a signed int32 (int32 makes sense for the
|
||||
// inspector_protocol, it's not a CBOR limitation); in CBOR,
|
||||
// the negative values for INT32 are represented as NEGATIVE,
|
||||
// that is, -1 INT32 is represented as 1 << 5 | 0 (major type 1,
|
||||
// additional info value 0). So here, we compute the INT32 value
|
||||
// and then check it against the INT32 min.
|
||||
int64_t actual_value =
|
||||
-static_cast<int64_t>(token_start_internal_value_) - 1;
|
||||
if (!success || actual_value < std::numeric_limits<int32_t>::min()) {
|
||||
// inspector_protocol, it's not a CBOR limitation); in CBOR, the
|
||||
// negative values for INT32 are represented as NEGATIVE, that is, -1
|
||||
// INT32 is represented as 1 << 5 | 0 (major type 1, additional info
|
||||
// value 0). The minimal allowed INT32 value in our protocol is
|
||||
// std::numeric_limits<int32_t>::min(). We check for it by directly
|
||||
// checking the payload against the maximal allowed signed (!) int32
|
||||
// value.
|
||||
if (!success || token_start_internal_value_ >
|
||||
std::numeric_limits<int32_t>::max()) {
|
||||
SetError(Error::CBOR_INVALID_INT32);
|
||||
return;
|
||||
}
|
||||
@@ -1864,7 +1865,7 @@ class JsonParser {
|
||||
// If the |Char| we're dealing with is really a byte, then
|
||||
// we have utf8 here, and we need to check for multibyte characters
|
||||
// and transcode them to utf16 (either one or two utf16 chars).
|
||||
if (sizeof(Char) == sizeof(uint8_t) && c >= 0x7f) {
|
||||
if (sizeof(Char) == sizeof(uint8_t) && c > 0x7f) {
|
||||
// Inspect the leading byte to figure out how long the utf8
|
||||
// byte sequence is; while doing this initialize |codepoint|
|
||||
// with the first few bits.
|
||||
@@ -1903,7 +1904,7 @@ class JsonParser {
|
||||
// Disallow overlong encodings for ascii characters, as these
|
||||
// would include " and other characters significant to JSON
|
||||
// string termination / control.
|
||||
if (codepoint < 0x7f)
|
||||
if (codepoint <= 0x7f)
|
||||
return false;
|
||||
// Invalid in UTF8, and can't be represented in UTF16 anyway.
|
||||
if (codepoint > 0x10ffff)
|
||||
|
||||
Reference in new issue
Block a user