summaryrefslogtreecommitdiff
path: root/HTTPcode.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-09-25 01:38:21 +0100
committerDave Hibberd <hibby@debian.org>2024-09-25 01:38:21 +0100
commit313013b5162f54c21440a9dcad1518427f4fcf71 (patch)
tree291c79316bcbb6c96ca36c789068e8569a344739 /HTTPcode.c
parent8da3573e9db4a5fbb2beb30d35f0a5bda4bbb5bf (diff)
parentb18a579b0c56cbf065714972a48c19d1662180e8 (diff)
Merge branch 'debian/latest' into debian/bookworm
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