From 2a7ad9b5fb0df2b3dc155cffc0d3b9c3fcc25290 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Tue, 3 Jun 2014 00:48:39 -0600 Subject: [PATCH] Bug 4050: Segfault in CommSelectEngine::checkEvents on helper response --- src/external_acl.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/external_acl.cc b/src/external_acl.cc index 88f40809d5..33451377d8 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -1603,14 +1603,16 @@ ExternalACLLookup::LookupDone(void *data, void *result) checklist->extacl_entry = cbdataReference((external_acl_entry *)result); // attach the helper kv-pair to the transaction - if (HttpRequest * req = checklist->request) { - // XXX: we have no access to the transaction / AccessLogEntry so cant SyncNotes(). - // workaround by using anything already set in HttpRequest - // OR use new and rely on a later Sync copying these to AccessLogEntry - if (!req->notes) - req->notes = new NotePairs; - - req->notes->appendNewOnly(&checklist->extacl_entry->notes); + if (checklist->extacl_entry) { + if (HttpRequest * req = checklist->request) { + // XXX: we have no access to the transaction / AccessLogEntry so cant SyncNotes(). + // workaround by using anything already set in HttpRequest + // OR use new and rely on a later Sync copying these to AccessLogEntry + if (!req->notes) + req->notes = new NotePairs; + + req->notes->appendNewOnly(&checklist->extacl_entry->notes); + } } checklist->resumeNonBlockingCheck(ExternalACLLookup::Instance()); -- 2.47.2