logswan

Fast Web log analyzer using probabilistic data structures
Log | Files | Refs | README | LICENSE

commit 5eb4383c1b3c7997d9a94a1ffff4718c6fb7acbc
parent eaad0c4fcfcdd3dcb6631ff3cb59ca59c9cbb4a2
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed,  7 Dec 2016 21:53:58 +0100

If parsedLine.remoteHost is NULL, the log line is invalid

Diffstat:
Msrc/logswan.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/logswan.c b/src/logswan.c @@ -159,6 +159,10 @@ int main (int argc, char *argv[]) { if (parsedLine.remoteHost) { /* Do not feed NULL tokens to inet_pton */ isIPv4 = inet_pton(AF_INET, parsedLine.remoteHost, &(ipv4.sin_addr)); isIPv6 = inet_pton(AF_INET6, parsedLine.remoteHost, &(ipv6.sin6_addr)); + } else { + /* Invalid line */ + results.invalidLines++; + continue; } if (isIPv4 || isIPv6) {