billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=c11f7e4c19287e6de64061fe4d58d88c38c4a6b5

commit c11f7e4c19287e6de64061fe4d58d88c38c4a6b5
Author: Boris Faure <[email protected]>
Date:   Sun Sep 15 23:05:38 2019 +0200

    termptyesc: restrict DSR-DECCKSR argument to 16bit (unsigned)
---
 src/bin/termptyesc.c | 5 ++++-
 tests/tests.results  | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index b01eb5f..a92b4db 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -1382,7 +1382,10 @@ _handle_esc_csi_dsr(Termpty *ty, Eina_Unicode *b)
            {
               /* DSR-DECCKSR (Memory Checksum) */
               int pid = _csi_arg_get(ty, &b);
-              len = snprintf(bf, sizeof(bf), "\033P%d!~0000\033\\", pid);
+              if (pid == -CSI_ARG_NO_VALUE)
+                pid = 65535;
+              len = snprintf(bf, sizeof(bf), "\033P%u!~0000\033\\",
+                             ((unsigned int)pid) % 65536);
               termpty_write(ty, bf, len);
            }
          else
diff --git a/tests/tests.results b/tests/tests.results
index 3876ee1..7471fa2 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -24,7 +24,7 @@ dsr-cpr.sh 02ee0151d9e9a227f16c40c27eb50604
 dsr-dir.sh f97a921eba6f15c69b3b39637ca8ecd2
 dsr-kbd.sh 31641f6172a325c31a3caeeb859028bc
 dsr-msr.sh 90f10362c318c613f6e8e6c7144019e9
-dsr-deccksr.sh 9dcfa80e4e6e3f11d136238bb5baecd3
+dsr-deccksr.sh 597a26f7661c87084a94b462261b9a3a
 dsr-os.sh bcb52de736fd1a0411d24975f6b7535f
 dsr-pp.sh 37fc9b7c28b6b61be89f395d322b1b7e
 dsr-udk.sh 0d8dd90df01e63af33924cd49e0df945

-- 


Reply via email to