ensure internal buffer is large enough for string after flushing (closes #24481)
diff --git a/Lib/test/test_hotshot.py b/Lib/test/test_hotshot.py
index 7da9746..9f4b798 100644
--- a/Lib/test/test_hotshot.py
+++ b/Lib/test/test_hotshot.py
@@ -149,6 +149,10 @@
         stats.load(self.logfn)
         os.unlink(self.logfn)
 
+    def test_large_info(self):
+        p = self.new_profiler()
+        self.assertRaises(ValueError, p.addinfo, "A", "A" * 0xfceb)
+
 
 def test_main():
     test_support.run_unittest(HotShotTestCase)