Sorry, the change of screenterm[] size touches the communication msg size.

Here is a patch to revert it to a size of 20, but still using a define for the 
length.

Regards, Tim

diff --git a/src/screen.h b/src/screen.h
index 15bd59b..3effffe 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -96,7 +96,7 @@
 #define MSGWAIT 	5
 #define MSGMINWAIT 	1
 #define SILENCEWAIT	30
-#define SCREENTERMSIZE		64
+#define SCREENTERMSIZE		20
 
 /*
  * if a nasty user really wants to try a history of 3000 lines on all 10
diff --git a/src/socket.c b/src/socket.c
index 1db1af9..8000a03 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -684,8 +684,8 @@ struct NewWindow *nwin;
       return;
     }
   if (nwin->term != nwin_undef.term)
-    strncpy(m.m.create.screenterm, nwin->term, 19);
-  m.m.create.screenterm[19] = '\0';
+    strncpy(m.m.create.screenterm, nwin->term, SCREENTERMSIZE-1);
+  m.m.create.screenterm[SCREENTERMSIZE-1] = '\0';
   m.protocol_revision = MSG_REVISION;
   debug1("SendCreateMsg writing '%s'\n", m.m.create.line);
   if (write(s, (char *) &m, sizeof m) != sizeof m)

Reply via email to