diff options
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 |