summaryrefslogtreecommitdiff
path: root/HTTPcode.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-08-30 10:15:03 +0100
committerDave Hibberd <hibby@debian.org>2024-08-30 10:15:03 +0100
commitb26c87817a84747300d1ca59d80feff10976f22e (patch)
treef2fcfcd42b93b449850ab1f78c254af392b5c922 /HTTPcode.c
parent60585818de254e8921fca42f55c175aa52e77e1e (diff)
parent6dfe32758e1a995b1241af8c981798c22cd70439 (diff)
Update upstream source from tag 'upstream/6.0.24.42'
Update to upstream version '6.0.24.42' with Debian dir 41e80b6ddfe044cd65e1f3985d66d43c24aadd9f
Diffstat (limited to 'HTTPcode.c')
-rw-r--r--HTTPcode.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/HTTPcode.c b/HTTPcode.c
index 367146d..e1ddfbe 100644
--- a/HTTPcode.c
+++ b/HTTPcode.c
@@ -600,7 +600,8 @@ VOID HTTPTimer()
for (n = Last;;)
{
- strcat(_REPLYBUFFER, Session->ScreenLines[n]);
+ if ((strlen(Session->ScreenLines[n]) + strlen(_REPLYBUFFER)) < 99999)
+ strcat(_REPLYBUFFER, Session->ScreenLines[n]);
if (n == 99)
n = -1;
@@ -680,13 +681,15 @@ struct HTTPConnectionInfo * FindSession(char * Key)
void ProcessTermInput(SOCKET sock, char * MsgPtr, int MsgLen, char * Key)
{
- char _REPLYBUFFER[1024];
+ char _REPLYBUFFER[2048];
int ReplyLen;
char Header[256];
int HeaderLen;
int State;
struct HTTPConnectionInfo * Session = FindSession(Key);
int Stream;
+ int maxlen = 1000;
+
if (Session == NULL)
{
@@ -701,12 +704,24 @@ void ProcessTermInput(SOCKET sock, char * MsgPtr, int MsgLen, char * Key)
char c;
UCHAR hex;
+ int msglen = end - input;
+
struct TNCINFO * TNC = Session->TNC;
struct TCPINFO * TCP = 0;
if (TNC)
TCP = TNC->TCPInfo;
+ if (TCP && TCP->WebTermCSS)
+ maxlen -= strlen(TCP->WebTermCSS);
+
+ if (MsgLen > maxlen)
+ {
+ Session->KillTimer = 99999; // close session
+ return;
+ }
+
+
if (TCP && TCP->WebTermCSS)
ReplyLen = sprintf(_REPLYBUFFER, InputLine, Key, TCP->WebTermCSS);
else