kore

a fork of the worlds most advanced web framework
Log | Files | Refs | README | LICENSE

commit bae117b68c60c63fd93f6bb4605a358ba958cd49
parent d4f4e007e01fead4244723bd67d2c0ad6d96a409
Author: Frederic Cambus <fred@statdns.com>
Date:   Sun,  9 Jun 2019 21:16:28 +0200

Set req->agent to "-" if it is NULL, as do other major HTTP servers.

This avoids passing a NULL value to a format string when writing a log
entry.

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

diff --git a/src/accesslog.c b/src/accesslog.c @@ -102,6 +102,9 @@ kore_accesslog(struct http_request *req) else referer = "-"; + if (req->agent == NULL) + req->agent = "-"; + cn = "-"; #if !defined(KORE_NO_TLS) if (req->owner->cert != NULL) {