public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH vncterm 1/4] Remove dead code and buffer-overflow
       [not found] <20250823083010.145866-1-aclopte@gmail.com>
@ 2025-08-23  8:17 ` Johannes Altmanninger via pve-devel
  2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 2/4] Remove unused state from OSC parser Johannes Altmanninger via pve-devel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: Johannes Altmanninger via pve-devel @ 2025-08-23  8:17 UTC (permalink / raw)
  To: pve-devel; +Cc: Johannes Altmanninger

[-- Attachment #1: Type: message/rfc822, Size: 6811 bytes --]

From: Johannes Altmanninger <aclopte@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Johannes Altmanninger <aclopte@gmail.com>
Subject: [PATCH vncterm 1/4] Remove dead code and buffer-overflow
Date: Sat, 23 Aug 2025 10:17:05 +0200
Message-ID: <20250823083010.145866-2-aclopte@gmail.com>

Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>
---
 vncterm.c | 13 ++-----------
 vncterm.h |  2 --
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/vncterm.c b/vncterm.c
index 3dd5d4e..fd71092 100644
--- a/vncterm.c
+++ b/vncterm.c
@@ -1276,8 +1276,6 @@ static void vncterm_putchar(vncTerm *vt, unicode ch) {
         case '1':
         case '2':
         case '4':
-            vt->osc_cmd = ch;
-            vt->osc_textbuf[0] = 0;
             vt->tty_state = ESosc1;
             break;
         default:
@@ -1299,16 +1297,9 @@ static void vncterm_putchar(vncTerm *vt, unicode ch) {
         }
         break;
     case ESosc2:
-        if (ch != 0x9c && ch != 7) {
-            int i = 0;
-            while (vt->osc_textbuf[i]) {
-                i++;
-            }
-            vt->osc_textbuf[i++] = ch;
-            vt->osc_textbuf[i] = 0;
-        } else {
+        if (ch == 0x9c || ch != 7) {
 #ifdef DEBUG
-            fprintf(stderr, "OSC:%c:%s\n", vt->osc_cmd, vt->osc_textbuf);
+            fprintf(stderr, "OSC sequence\n");
 #endif
             vt->tty_state = ESnormal;
         }
diff --git a/vncterm.h b/vncterm.h
index 7887d9b..82f9959 100644
--- a/vncterm.h
+++ b/vncterm.h
@@ -58,8 +58,6 @@ typedef struct vncTerm {
     unsigned int esc_count;
     unsigned int esc_ques;
     unsigned int esc_has_par;
-    char osc_textbuf[4096];
-    char osc_cmd;
     unsigned int region_top;
     unsigned int region_bottom;
 
-- 
2.50.1.194.g038143def7



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] [PATCH vncterm 2/4] Remove unused state from OSC parser
       [not found] <20250823083010.145866-1-aclopte@gmail.com>
  2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 1/4] Remove dead code and buffer-overflow Johannes Altmanninger via pve-devel
@ 2025-08-23  8:17 ` Johannes Altmanninger via pve-devel
  2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 3/4] Parse more OSC sequences Johannes Altmanninger via pve-devel
  2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 4/4] Also parse DCS commands Johannes Altmanninger via pve-devel
  3 siblings, 0 replies; 4+ messages in thread
From: Johannes Altmanninger via pve-devel @ 2025-08-23  8:17 UTC (permalink / raw)
  To: pve-devel; +Cc: Johannes Altmanninger

[-- Attachment #1: Type: message/rfc822, Size: 6494 bytes --]

From: Johannes Altmanninger <aclopte@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Johannes Altmanninger <aclopte@gmail.com>
Subject: [PATCH vncterm 2/4] Remove unused state from OSC parser
Date: Sat, 23 Aug 2025 10:17:06 +0200
Message-ID: <20250823083010.145866-3-aclopte@gmail.com>

Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>
---
 vncterm.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/vncterm.c b/vncterm.c
index fd71092..83f6bf6 100644
--- a/vncterm.c
+++ b/vncterm.c
@@ -1195,8 +1195,7 @@ enum {
     ESnonstd,
     ESpalette,
     ESidquery,
-    ESosc1,
-    ESosc2
+    ESosc,
 };
 
 static void vncterm_putchar(vncTerm *vt, unicode ch) {
@@ -1276,7 +1275,7 @@ static void vncterm_putchar(vncTerm *vt, unicode ch) {
         case '1':
         case '2':
         case '4':
-            vt->tty_state = ESosc1;
+            vt->tty_state = ESosc;
             break;
         default:
 #ifdef DEBUG
@@ -1286,17 +1285,7 @@ static void vncterm_putchar(vncTerm *vt, unicode ch) {
             break;
         }
         break;
-    case ESosc1:
-        vt->tty_state = ESnormal;
-        if (ch == ';') {
-            vt->tty_state = ESosc2;
-        } else {
-#ifdef DEBUG
-            fprintf(stderr, "got illegal OSC sequence\n");
-#endif
-        }
-        break;
-    case ESosc2:
+    case ESosc:
         if (ch == 0x9c || ch != 7) {
 #ifdef DEBUG
             fprintf(stderr, "OSC sequence\n");
-- 
2.50.1.194.g038143def7



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] [PATCH vncterm 3/4] Parse more OSC sequences
       [not found] <20250823083010.145866-1-aclopte@gmail.com>
  2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 1/4] Remove dead code and buffer-overflow Johannes Altmanninger via pve-devel
  2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 2/4] Remove unused state from OSC parser Johannes Altmanninger via pve-devel
@ 2025-08-23  8:17 ` Johannes Altmanninger via pve-devel
  2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 4/4] Also parse DCS commands Johannes Altmanninger via pve-devel
  3 siblings, 0 replies; 4+ messages in thread
From: Johannes Altmanninger via pve-devel @ 2025-08-23  8:17 UTC (permalink / raw)
  To: pve-devel; +Cc: Johannes Altmanninger

[-- Attachment #1: Type: message/rfc822, Size: 6396 bytes --]

From: Johannes Altmanninger <aclopte@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Johannes Altmanninger <aclopte@gmail.com>
Subject: [PATCH vncterm 3/4] Parse more OSC sequences
Date: Sat, 23 Aug 2025 10:17:07 +0200
Message-ID: <20250823083010.145866-4-aclopte@gmail.com>

To reproduce the problem, run in Bash:

	$ printf '\x1b]133;A;click_events=1\x07'

Fixes https://bugzilla.proxmox.com/show_bug.cgi?id=6575

Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>
---
 vncterm.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/vncterm.c b/vncterm.c
index 83f6bf6..0c45a91 100644
--- a/vncterm.c
+++ b/vncterm.c
@@ -1271,17 +1271,8 @@ static void vncterm_putchar(vncTerm *vt, unicode ch) {
         case 'R': /* reset palette */
             // fixme: reset_palette(vc);
             break;
-        case '0':
-        case '1':
-        case '2':
-        case '4':
-            vt->tty_state = ESosc;
-            break;
         default:
-#ifdef DEBUG
-            fprintf(stderr, "unhandled OSC %c\n", ch);
-#endif
-            vt->tty_state = ESnormal;
+            vt->tty_state = ESosc;
             break;
         }
         break;
-- 
2.50.1.194.g038143def7



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] [PATCH vncterm 4/4] Also parse DCS commands
       [not found] <20250823083010.145866-1-aclopte@gmail.com>
                   ` (2 preceding siblings ...)
  2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 3/4] Parse more OSC sequences Johannes Altmanninger via pve-devel
@ 2025-08-23  8:17 ` Johannes Altmanninger via pve-devel
  3 siblings, 0 replies; 4+ messages in thread
From: Johannes Altmanninger via pve-devel @ 2025-08-23  8:17 UTC (permalink / raw)
  To: pve-devel; +Cc: Johannes Altmanninger

[-- Attachment #1: Type: message/rfc822, Size: 6529 bytes --]

From: Johannes Altmanninger <aclopte@gmail.com>
To: pve-devel@lists.proxmox.com
Cc: Johannes Altmanninger <aclopte@gmail.com>
Subject: [PATCH vncterm 4/4] Also parse DCS commands
Date: Sat, 23 Aug 2025 10:17:08 +0200
Message-ID: <20250823083010.145866-5-aclopte@gmail.com>

This is used by some commands like XTGETTCAP.

Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>
---
 vncterm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vncterm.c b/vncterm.c
index 0c45a91..3d795d7 100644
--- a/vncterm.c
+++ b/vncterm.c
@@ -1218,6 +1218,7 @@ static void vncterm_putchar(vncTerm *vt, unicode ch) {
             vt->tty_state = ESsquare;
             break;
         case ']':
+        case 'P':
             vt->tty_state = ESnonstd;
             break;
         case '%':
@@ -1256,7 +1257,7 @@ static void vncterm_putchar(vncTerm *vt, unicode ch) {
             break;
         }
         break;
-    case ESnonstd: /* Operating System Controls */
+    case ESnonstd: /* Operating System Command or Device Control String */
         vt->tty_state = ESnormal;
 
         switch (ch) {
@@ -1279,7 +1280,7 @@ static void vncterm_putchar(vncTerm *vt, unicode ch) {
     case ESosc:
         if (ch == 0x9c || ch != 7) {
 #ifdef DEBUG
-            fprintf(stderr, "OSC sequence\n");
+            fprintf(stderr, "OSC/DCS sequence\n");
 #endif
             vt->tty_state = ESnormal;
         }
-- 
2.50.1.194.g038143def7



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-27  7:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20250823083010.145866-1-aclopte@gmail.com>
2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 1/4] Remove dead code and buffer-overflow Johannes Altmanninger via pve-devel
2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 2/4] Remove unused state from OSC parser Johannes Altmanninger via pve-devel
2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 3/4] Parse more OSC sequences Johannes Altmanninger via pve-devel
2025-08-23  8:17 ` [pve-devel] [PATCH vncterm 4/4] Also parse DCS commands Johannes Altmanninger via pve-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal