]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 14 Oct 2018 05:25:34 +0000 (18:25 +1300)
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 da6d25f4759b343e4e562030c3df965fe6c70450..c1e19b4788a7912797f67b61c6d48af0a17b1f5a 100644 (file)
@@ -1193,7 +1193,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;
@@ -1203,7 +1203,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;