From a18e2540fb5a15dcbc066ed51d4e98da7a69869f Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Mon, 2 Feb 2015 01:08:37 +0000 Subject: [PATCH] Fix: Allow client=NULL in util_http_build_header() This fixes a bug in 8941de3273975504aaa00a35d145c3f26c832d70: When passing NULL as client parameter to util_http_build_header() there was a segfault before this change. --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 4abf9198..7d9c5b28 100644 --- a/src/util.c +++ b/src/util.c @@ -711,7 +711,7 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset, status_buffer, config->server_id, connection_header, - (client->admin_command == ADMIN_COMMAND_ERROR ? + (client && client->admin_command == ADMIN_COMMAND_ERROR ? "GET, SOURCE" : "GET"), (config->tls_ok ? "Upgrade: TLS/1.0\r\n" : ""), currenttime_buffer,