From 192ab59608ce43358e12b1917b23262f607fcf7a Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Thu, 28 Apr 2016 20:40:16 +0000 Subject: [PATCH] resolver: fixed uninitialised var --- src/ostypes.h | 5 ++++- src/resolver.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ostypes.h b/src/ostypes.h index c3c8f47..6e9a5ae 100644 --- a/src/ostypes.h +++ b/src/ostypes.h @@ -30,8 +30,11 @@ typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef unsigned __int64 uint64_t; +#ifndef UINT16_MAX +#define UINT16_MAX ((uint16_t)0xffff) +#endif /* UINT16_MAX */ #ifndef UINT32_MAX -#define UINT32_MAX 0xffffffff +#define UINT32_MAX ((uint32_t)0xffffffff) #endif /* UINT32_MAX */ #ifndef SIZE_MAX #define SIZE_MAX UINT32_MAX diff --git a/src/resolver.c b/src/resolver.c index 5faa171..2e9d3c3 100644 --- a/src/resolver.c +++ b/src/resolver.c @@ -157,6 +157,7 @@ int resolver_srv_lookup_buf(const unsigned char *buf, size_t len, * RFC2052: A client MUST attempt to contact the target host * with the lowest-numbered priority it can reach. */ + priority_min = UINT16_MAX; for (i = 0; i < header.ancount; ++i) { name_len = message_name_len(buf, len, j); j += name_len;