Fix signed-unsigned comparison. Envoy compilation fails due to -Wsign-compare, because char is signed in Envoy. Even though Balsa is compiled with this warning internally, it compiles internally because char is unsigned. Change `c` to `size_t` to make sure the comparison to `std::numeric_limits<size_t>::max() - length_x_10` is always between two unsigned expressions. PiperOrigin-RevId: 445979285
diff --git a/quiche/common/balsa/balsa_frame.cc b/quiche/common/balsa/balsa_frame.cc index 5f9d9d2..3762772 100644 --- a/quiche/common/balsa/balsa_frame.cc +++ b/quiche/common/balsa/balsa_frame.cc
@@ -487,7 +487,7 @@ } const size_t kMaxDiv10 = std::numeric_limits<size_t>::max() / 10; size_t length_x_10 = *length * 10; - const char c = *value_begin - '0'; + const size_t c = *value_begin - '0'; if (*length > kMaxDiv10 || (std::numeric_limits<size_t>::max() - length_x_10) < c) { QUICHE_DVLOG(1) << "content-length overflow";