]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed %USER_CA_CERT_xx and %USER_CERT_xx crashes (#301)
authorchi-mf <43963496+chi-mf@users.noreply.github.com>
Wed, 10 Oct 2018 07:50:52 +0000 (07:50 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 10 Oct 2018 15:24:44 +0000 (15:24 +0000)
The bug was introduced in 4e56d7f6 when the formatting code was moved
into Format::Format::assemble() where the old "format" loop variable is
a Format data member with the right type but (usually) the wrong value.

src/format/Format.cc

index ec9b3db08fa491b44828cbb5b0cefa25dfdf4e15..663cba123ab4e01dd28d61ef368fa1af5631f849 100644 (file)
@@ -1199,7 +1199,7 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS
                 ConnStateData *conn = al->request->clientConnectionManager.get();
                 if (conn && Comm::IsConnOpen(conn->clientConnection)) {
                     if (auto ssl = fd_table[conn->clientConnection->fd].ssl.get())
-                        out = sslGetUserAttribute(ssl, format->data.header.header);
+                        out = sslGetUserAttribute(ssl, fmt->data.header.header);
                 }
             }
             break;
@@ -1209,7 +1209,7 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS
                 ConnStateData *conn = al->request->clientConnectionManager.get();
                 if (conn && Comm::IsConnOpen(conn->clientConnection)) {
                     if (auto ssl = fd_table[conn->clientConnection->fd].ssl.get())
-                        out = sslGetCAAttribute(ssl, format->data.header.header);
+                        out = sslGetCAAttribute(ssl, fmt->data.header.header);
                 }
             }
             break;