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

git pushed a commit to branch tymux
in repository terminology.

View the commit online.

commit 6929da18f443ce21b301036fcda6d71113c070a2
Author: [email protected] <[email protected]>
AuthorDate: Mon Mar 23 22:34:13 2026 -0600

    fix(tymux): validate attach mode byte before enum cast
    
    Range-check the mode byte from the ATTACH payload before casting
    to TermSrvAttachMode, keeping the variable within the enum domain
    at all times.
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---
 src/bin/termd_tymux.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/bin/termd_tymux.c b/src/bin/termd_tymux.c
index d08d6381..f87118c5 100644
--- a/src/bin/termd_tymux.c
+++ b/src/bin/termd_tymux.c
@@ -800,7 +800,11 @@ termd_tymux_client_add(TermDTymux *sess, int cfd)
 
    /* Extract mode from first payload byte; default HIJACK if absent */
    if (payload && size >= 1)
-     mode = (TermSrvAttachMode)((const uint8_t *)payload)[0];
+     {
+        uint8_t m = ((const uint8_t *)payload)[0];
+        if (m <= TSRV_ATTACH_READONLY)
+          mode = (TermSrvAttachMode)m;
+     }
    free(payload);
    payload = NULL;
 

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

Reply via email to