Skip to content

Commit

Permalink
Merge pull request qt#98 from autodesk-forks/huangw/FixCVE-2023-51714
Browse files Browse the repository at this point in the history
fix CVE 2023 51714
  • Loading branch information
huangw02 authored and GitHub Enterprise committed Feb 7, 2024
2 parents 2f1a8c1 + 76a65aa commit 60e8e10
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/network/access/http2/hpacktable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ HeaderSize entry_size(QByteArrayView name, QByteArrayView value)
// for counting the number of references to the name and value would have
// 32 octets of overhead."

const unsigned sum = unsigned(name.size() + value.size());
if (std::numeric_limits<unsigned>::max() - 32 < sum)
size_t sum;
if (qAddOverflow(size_t(name.size()), size_t(value.size()), &sum))
return HeaderSize();
if (sum > (std::numeric_limits<unsigned>::max() - 32))
return HeaderSize();
return HeaderSize(true, quint32(sum + 32));
}
Expand Down

0 comments on commit 60e8e10

Please sign in to comment.