diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-07-10 23:02:42 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-07-10 23:02:42 +0100 |
commit | b98da7cb52a0b6969ff43c921ea40ce4270e5736 (patch) | |
tree | fc155666fced93001178db356f5b11fc31008949 /blabouncer.c | |
parent | 726496b1711117d113b8da971edf8114db07ab06 (diff) |
Make sure messages aren't too long after combining truncated messages.
Diffstat (limited to 'blabouncer.c')
-rw-r--r-- | blabouncer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c index 8f5afad..ddcd07f 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -301,6 +301,11 @@ int processrawstring(SSL *server_ssl, char *str, int source, struct client *clie debugprint(DEBUG_FULL, "...into new string '%s' and clearing currentmsg holding area.\n", messages[0]); ircdstate->currentmsg[0] = '\0'; free(strtmp); + // Make sure the resulting message isn't too long + if (strlen(messages[0]) >= MAXDATASIZE - 1) { + debugprint(DEBUG_CRIT, "processrawstring(): combined truncated message '%d' is too long (%ld out of a maximum of %d characters), clearing it.\n", messages[0], strlen(messages[0]), MAXDATASIZE - 1); + messages[0][0] = '\0'; + } } // If the final characters of the raw string weren't \r\n then assume the final token is a truncated message |