From c2ff18a157749c141e556405fdc96101c8bd55e7 Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Mon, 4 Sep 2006 07:04:39 +0000 Subject: [PATCH] [ darkhttpd-1.4 release ] Fix a segfault in log_connection() that happens when the incoming request is too long. (Forgot to bump the version) --- trunk/darkhttpd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trunk/darkhttpd.c b/trunk/darkhttpd.c index f4599bc..afe8c47 100644 --- a/trunk/darkhttpd.c +++ b/trunk/darkhttpd.c @@ -2177,8 +2177,12 @@ static void log_connection(const struct connection *conn) { struct in_addr inaddr; - if (logfile == NULL) return; - if (conn->http_code == 0) return; /* invalid - died in request */ + if (logfile == NULL) + return; + if (conn->http_code == 0) + return; /* invalid - died in request */ + if (conn->method == NULL) + return; /* invalid - didn't parse - maybe too long */ /* Separated by tabs: * time client_ip method uri http_code bytes_sent "referer" "user-agent"