From ff6a27127863cc7bbec1cd6f1725913c5f1c5e3a Mon Sep 17 00:00:00 2001 From: despair Date: Tue, 13 Nov 2018 06:54:44 -0600 Subject: [PATCH 1/2] why would pos ever be negative? --- CMakeLists.txt | 1 + llarp/dnsc.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37d0886bc..ccaeb5cef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,7 @@ endif() if(WIN32) add_compile_options($<$:-Wno-bad-function-cast>) +add_compile_options(-Wno-cast-function-type) set(FS_LIB stdc++fs) endif(WIN32) diff --git a/llarp/dnsc.cpp b/llarp/dnsc.cpp index f3cea6f5b..70907f04e 100644 --- a/llarp/dnsc.cpp +++ b/llarp/dnsc.cpp @@ -299,7 +299,7 @@ generic_handle_dnsc_recvfrom(dnsc_answer_request *request, llarp::LogDebug("Read an authority for ", request->question.name, " at ", std::to_string(pos)); // castBuf += answer->name.length() + 4 + 4 + 4 + answer->rdLen; - if(pos > sz) + if((ssize_t)pos > sz) { llarp::LogWarn("Would read past end of dns packet. for ", request->question.name); From 715e59808ef9ee9954deb0cae810c43a96cf227a Mon Sep 17 00:00:00 2001 From: despair Date: Tue, 13 Nov 2018 07:58:25 -0600 Subject: [PATCH 2/2] bad merge! --- llarp/ev_win32.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/llarp/ev_win32.hpp b/llarp/ev_win32.hpp index 510006522..3f7f37830 100644 --- a/llarp/ev_win32.hpp +++ b/llarp/ev_win32.hpp @@ -248,7 +248,6 @@ namespace llarp setup() { llarp::LogDebug("set ifname to ", t->ifname); - strncpy(tunif->if_name, t->ifname, IFNAMSIZ); if(tuntap_start(tunif, TUNTAP_MODE_TUNNEL, 0) == -1) {