Add counter for occurrences of trailing decimal points To help determine whether it's safe to fix the erroneous behavior. PiperOrigin-RevId: 936003838
diff --git a/quiche/common/structured_headers.cc b/quiche/common/structured_headers.cc index ce1c82a..0b3947d 100644 --- a/quiche/common/structured_headers.cc +++ b/quiche/common/structured_headers.cc
@@ -396,10 +396,16 @@ LogParseError("ReadNumber", "too many digits after decimal"); return std::nullopt; } + // TODO(b/517189418): This is never reached due to an off-by-one error. if (i == decimal_position) { LogParseError("ReadNumber", "no digits after decimal"); return std::nullopt; } + // Counter to track instances of b/517189418 in which trailing decimal + // points are erroneously accepted. + if (i == decimal_position + 1) { + QUICHE_CODE_COUNT(decimal_with_zero_fractional_digits); + } } std::string output_number_string(input_.substr(0, i)); input_.remove_prefix(i);