aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-09-28 10:08:58 +0200
committerRiccardo Spagni <ric@spagni.net>2015-09-28 10:09:01 +0200
commit419d70eb1fb8fae8476086dfdd163e63dff9d367 (patch)
treeb5da9bcfbd1b877c17ac11d732d92b06c44663cc
parentMerge pull request #405 (diff)
parentdns_utils: fix wrong asserts (diff)
downloadmonero-419d70eb1fb8fae8476086dfdd163e63dff9d367.tar.xz
Merge pull request #409
151c32d dns_utils: fix wrong asserts (moneromooo-monero)
-rw-r--r--src/common/dns_utils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
index 5cb5ed2de..2ae5d9624 100644
--- a/src/common/dns_utils.cpp
+++ b/src/common/dns_utils.cpp
@@ -102,7 +102,7 @@ namespace tools
// fuck it, I'm tired of dealing with getnameinfo()/inet_ntop/etc
std::string ipv4_to_string(const char* src, size_t len)
{
- assert(memchr(src, 0, len));
+ assert(len >= 4);
std::stringstream ss;
unsigned int bytes[4];
@@ -122,7 +122,7 @@ std::string ipv4_to_string(const char* src, size_t len)
// stop-gap measure and to make the tests pass at least...
std::string ipv6_to_string(const char* src, size_t len)
{
- assert(memchr(src, 0, len));
+ assert(len >= 8);
std::stringstream ss;
unsigned int bytes[8];