From a55c87e01619671d41c475968ef594af24c9630b Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Fri, 27 Oct 2023 15:45:03 -0400 Subject: [PATCH] gay --- CMakeLists.txt | 4 ++-- src/main.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2aa2ac1..50059f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,8 +37,8 @@ if(CMAKE_THREAD_LIBS_INIT) endif() -target_compile_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Wno-comment -Wno-format) -target_link_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Wno-comment -Wno-format) +target_compile_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Werror=return-local-addr -Wno-comment -Wno-format) +target_link_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Werror=return-local-addr -Wno-comment -Wno-format) if (${ENABLE_ADDRSAN} MATCHES ON) target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=address) diff --git a/src/main.cpp b/src/main.cpp index a36b956..5519dd3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,7 +35,7 @@ static constexpr unsigned short int SERVER_PORT = 5555; */ static BLT_CPP20_CONSTEXPR bind_address address() { return {SERVER_PORT}; -}; +} /** should we strictly match results? ie block `*wikipedia.org*` or just `wikipedia.org`? */ static constexpr bool STRICT_MATCHING = false; @@ -352,7 +352,8 @@ request_info handle_forward_request(MESSENGER messenger, const INFO& info, const // forward to google. size_t out_bytes; - messenger(DNS_SERVER_IP(), input_recv_buffer.data(), bytes, forward_recv_buffer, out_bytes); + const auto* data = input_recv_buffer.data(); + messenger(DNS_SERVER_IP(), data, bytes, forward_recv_buffer, out_bytes); uint16_t num_of_answers; blt::mem::fromBytes(&forward_recv_buffer[info.ANSWERS_BEGIN], num_of_answers);