Skip to content

Commit

Permalink
Fix potential buffer overflow in xplat/fizz/protocol/ech/Encryption.cpp
Browse files Browse the repository at this point in the history
Reviewed By: AjanthanAsogamoorthy

Differential Revision: D49630747

fbshipit-source-id: 3881f5480efade9cdb879eb2a54e3ae398ace707
  • Loading branch information
Kyle Nekritz authored and facebook-github-bot committed Oct 9, 2023
1 parent 842547e commit 1b78334
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fizz/protocol/ech/Encryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,8 @@ size_t calculateECHPadding(
auto sni = getExtension<ServerNameList>(chlo.extensions);
if (sni) {
// Add max(0, maxLen - len(server_name))
size_t sniLen = sni->server_name_list[0].hostname->computeChainDataLength();
size_t sniLen =
sni->server_name_list.at(0).hostname->computeChainDataLength();
if (sniLen < maxLen) {
padding = maxLen - sniLen;
}
Expand Down

0 comments on commit 1b78334

Please sign in to comment.