resolver: fixed uninitialised var

This commit is contained in:
Dmitry Podgorny
2016-04-28 20:40:16 +00:00
parent a3da77b8f6
commit 192ab59608
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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;