summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-09-15 23:05:38 +0200
committerBoris Faure <billiob@gmail.com>2019-09-15 23:05:38 +0200
commitc11f7e4c19287e6de64061fe4d58d88c38c4a6b5 (patch)
tree3e07884b0370856bb0d300f729549bba63bdf5f2 /src
parentdbf92b1346f93d4937d57656b81b617d98bc109b (diff)
termptyesc: restrict DSR-DECCKSR argument to 16bit (unsigned)
Diffstat (limited to 'src')
-rw-r--r--src/bin/termptyesc.c5
1 files changed, 4 insertions, 1 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)
1382 { 1382 {
1383 /* DSR-DECCKSR (Memory Checksum) */ 1383 /* DSR-DECCKSR (Memory Checksum) */
1384 int pid = _csi_arg_get(ty, &b); 1384 int pid = _csi_arg_get(ty, &b);
1385 len = snprintf(bf, sizeof(bf), "\033P%d!~0000\033\\", pid); 1385 if (pid == -CSI_ARG_NO_VALUE)
1386 pid = 65535;
1387 len = snprintf(bf, sizeof(bf), "\033P%u!~0000\033\\",
1388 ((unsigned int)pid) % 65536);
1386 termpty_write(ty, bf, len); 1389 termpty_write(ty, bf, len);
1387 } 1390 }
1388 else 1391 else