]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix URN response exception handling (#479)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 21 Sep 2019 22:45:03 +0000 (22:45 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 22 Sep 2019 11:44:14 +0000 (11:44 +0000)
CID 1453857: Error handling issues (UNCAUGHT_EXCEPT)

Due to various Store deficiencies, storeUnregister() might call swapout
code which Broadcast()s and throws Ipc::OneToOneUniQueue::ItemTooLarge.

src/urn.cc

index efadc88151239793212aa5dc121135083ba2d83a..a6a2823eb3a42e67f891f7e877bcf56457e91718 100644 (file)
@@ -11,6 +11,7 @@
 #include "squid.h"
 #include "AccessLogEntry.h"
 #include "acl/FilledChecklist.h"
+#include "base/TextException.h"
 #include "cbdata.h"
 #include "errorpage.h"
 #include "FwdState.h"
@@ -78,16 +79,18 @@ CBDATA_CLASS_INIT(UrnState);
 
 UrnState::~UrnState()
 {
-    if (urlres_e) {
-        if (sc)
-            storeUnregister(sc, urlres_e, this);
-        urlres_e->unlock("~UrnState+res");
-    }
+    SWALLOW_EXCEPTIONS({
+        if (urlres_e) {
+            if (sc)
+                storeUnregister(sc, urlres_e, this);
+            urlres_e->unlock("~UrnState+res");
+        }
 
-    if (entry)
-        entry->unlock("~UrnState+prime");
+        if (entry)
+            entry->unlock("~UrnState+prime");
 
-    safe_free(urlres);
+        safe_free(urlres);
+    });
 }
 
 static url_entry *