Skip to content

Commit 5fffac3

Browse files
Re-sync with internal repository (#639)
The internal and external repositories are out of sync. This Pull Request attempts to brings them back in sync by patching the GitHub repository. Please carefully review this patch. You must disable ShipIt for your project in order to merge this pull request. DO NOT IMPORT this pull request. Instead, merge it directly on GitHub using the MERGE BUTTON. Re-enable ShipIt after merging. fbshipit-source-id: c9c298343c75e6ec23f6f2b075fece5d7950a7dd Co-authored-by: Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
1 parent f06591b commit 5fffac3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

proxygen/lib/http/codec/compress/QPACKDecoder.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ uint32_t QPACKDecoder::decodePrefix(HPACKDecodeBuffer& dbuf) {
9292
}
9393
}
9494
VLOG(5) << "Decoded requiredInsertCount=" << requiredInsertCount;
95+
if (requiredInsertCount > std::numeric_limits<uint32_t>::max()) {
96+
LOG(ERROR) << "requiredInsertCount out of range=" << requiredInsertCount;
97+
err_ = HPACK::DecodeError::INVALID_INDEX;
98+
return 0;
99+
}
95100
uint64_t delta = 0;
96101
if (dbuf.empty()) {
97102
LOG(ERROR) << "Invalid prefix, no delta-base";
@@ -112,10 +117,6 @@ uint32_t QPACKDecoder::decodePrefix(HPACKDecodeBuffer& dbuf) {
112117
err_ = HPACK::DecodeError::INVALID_INDEX;
113118
return 0;
114119
}
115-
// The largest table we support is 2^32 - 1 / 32 entries, so
116-
// requiredInsertCount (less any delta, etc) must be < 2^32.
117-
CHECK_LE(requiredInsertCount - delta - 1,
118-
std::numeric_limits<uint32_t>::max());
119120
baseIndex_ = requiredInsertCount - delta - 1;
120121
} else {
121122
// base must be < 2^32

0 commit comments

Comments
 (0)