This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch tymux-10-quiet-head
in repository terminology.

View the commit online.

commit 73fe0609bffa952bd59d4fbbf7ad6ad0f8e87136
Author: Boris Faure <[email protected]>
AuthorDate: Tue Nov 3 17:53:13 2026 +0000

    termpty: format replies under tyfuzz
    
    termpty_write() returned at once under BINARY_TYFUZZ, so the replies
    (DA, DECRQM, XTGETTCAP, colour queries, OSC 52) were formatted but
    never buffered. They now go to ty->write_buffer as in Terminology,
    dropped past 8 KiB since nothing drains it. tybench keeps the early
    return, so it still measures the shipping path.
---
 src/bin/termpty.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 3a5c6e54..32936fbb 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -1341,10 +1341,30 @@ termpty_cell_get(Termpty *ty, int y_requested, int x_requested)
 void
 termpty_write(Termpty *ty, const char *input, int len)
 {
+   int res;
+
 #if defined(BINARY_TYFUZZ)
+# if defined(BINARY_TYBENCH)
+   /* tybench measures the shipping intake path: no reply side. */
    return;
+# else
+   /* The fuzzer has no consumer on the other side of the pty, but the
+    * reply formatting code (DA, DECRQM, XTGETTCAP, OSC colour queries,
+    * OSC 52 read) must run so that the sanitizers see the replies being
+    * built and buffered. The buffer has to be dropped once it grows:
+    * nothing drains it, and a stream of CSI c would otherwise turn a
+    * fuzzing run into an allocation benchmark. */
+   if (ty->write_buffer.len > 8192)
+     ty_sb_free(&ty->write_buffer);
+   res = ty_sb_add(&ty->write_buffer, input, len);
+   if (res < 0)
+     {
+        ERR("failure to add %d characters to write buffer", len);
+     }
+   return;
+# endif
 #endif
-   int res = ty_sb_add(&ty->write_buffer, input, len);
+   res = ty_sb_add(&ty->write_buffer, input, len);
 
    if (res < 0)
      {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to