From e9f6ca339a8cd5670f31e2eca084c7a93a5a41d4 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 29 Jan 2019 22:08:51 +0000 Subject: [PATCH 1/2] Fix minor warning --- llarp/handlers/tun.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llarp/handlers/tun.hpp b/llarp/handlers/tun.hpp index a11faaa36..22bbcf7fe 100644 --- a/llarp/handlers/tun.hpp +++ b/llarp/handlers/tun.hpp @@ -80,7 +80,7 @@ namespace llarp /// get the local interface's address huint32_t - GetIfAddr() const; + GetIfAddr() const override; bool HasLocalIP(const huint32_t& ip) const; From c7e126a4261de0a405bfb5d8a29ea2ef31206142 Mon Sep 17 00:00:00 2001 From: Ryan Tharp Date: Wed, 30 Jan 2019 23:53:43 -0800 Subject: [PATCH 2/2] fix buffer overrun --- llarp/util/buffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llarp/util/buffer.cpp b/llarp/util/buffer.cpp index a2ec6f82f..d2bd9ad28 100644 --- a/llarp/util/buffer.cpp +++ b/llarp/util/buffer.cpp @@ -50,8 +50,8 @@ llarp_buffer_read_until(llarp_buffer_t* buff, char delim, byte_t* result, { size_t read = 0; - while(*buff->cur != delim && resultsize - && (buff->cur != buff->base + buff->sz)) + // do the bound check first, to avoid over running + while((buff->cur != buff->base + buff->sz) && *buff->cur != delim && resultsize) { *result = *buff->cur; buff->cur++;