]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Fix a crash when processing timeouts for incoming DoH queries 15482/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 28 Apr 2025 10:41:00 +0000 (12:41 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 29 Apr 2025 08:09:01 +0000 (10:09 +0200)
commit68edfd9be00f18101216eb394e3b18bd6feb77f4
treea3980caf7c82d4bb2d16a3b45cc86d064cdaab08
parent5c57b705f494c6ccffb0174a642f08c224f70749
dnsdist: Fix a crash when processing timeouts for incoming DoH queries

This commit fixes a double-free triggered by an exception being raised
while we are processing a timeout for an incoming DoH query. The exception
bypasses the call releasing the smart pointer, and thus the destructor
is called when we reach the end of the function since we own the smart
pointer, but unfortunately it has already been destroyed by the function
that raised the exception. The fix is to release the pointer first,
then call the function, so even if an exception is raised we no longer
own the pointer, and it's clear that the function has taken ownership of it.

(cherry picked from commit 954eb1921699147b16f8bcd08029e37da3e789b9)
pdns/dnsdist-doh-common.hh