about summary refs log tree commit diff
path: root/absl/strings/charconv_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/strings/charconv_test.cc')
-rw-r--r--absl/strings/charconv_test.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/strings/charconv_test.cc b/absl/strings/charconv_test.cc
index b58fad269d8b..9090e9c89c50 100644
--- a/absl/strings/charconv_test.cc
+++ b/absl/strings/charconv_test.cc
@@ -511,6 +511,13 @@ TEST(FromChars, Overflow) {
   EXPECT_EQ(f, std::numeric_limits<float>::max());
 }
 
+TEST(FromChars, RegressionTestsFromFuzzer) {
+  absl::string_view src = "0x21900000p00000000099";
+  float f;
+  auto result = absl::from_chars(src.data(), src.data() + src.size(), f);
+  EXPECT_EQ(result.ec, std::errc::result_out_of_range);
+}
+
 TEST(FromChars, ReturnValuePtr) {
   // Check that `ptr` points one past the number scanned, even if that number
   // is not representable.