From c3f58fdccc4a6019ca7b53c67f272f9c3c576051 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Mon, 27 May 2019 17:32:46 +0100 Subject: Correct mistake in previous MAXTOKENS buffer overflow commit. --- blabouncer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blabouncer.c b/blabouncer.c index e958828..a180b5a 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -1894,7 +1894,7 @@ int processrawstring(SSL *server_ssl, char *str, int source, struct client *clie while ((token = strsep(&strcopy, "\r\n")) != NULL) { if (*token == '\0') continue; // Skip consecutive matches - if (counter >= MAXTOKENS) break; // Too many tokens + if (messagecount >= MAXTOKENS) break; // Too many tokens printf("String Token: \"%s\", length %zd.\n", token, strlen(token)); // Copy into the token array (strlen + 1 to get the NULL terminator) strncpy(messages[messagecount], token, strlen(token) + 1); -- cgit v1.2.3