Fix asan/msan bug

PiperOrigin-RevId: 780237506
This commit is contained in:
Guogang Li
2025-07-07 13:30:50 -07:00
committed by Copybara-Service
parent 6a5d39eb59
commit a2bcb2db27
15 changed files with 25 additions and 24 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ std::string ByteUtils::ToFourDigitString(ByteArray& bytes) {
int multiplier = 1;
int hashCode = 0;
StreamReader stream_reader{bytes};
StreamReader stream_reader{&bytes};
while (stream_reader.IsAvailable(1)) {
auto byte = stream_reader.ReadInt8().value_or(0);
hashCode = (hashCode + byte * multiplier) % kHashBasePrime;