projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1455 from rubenk/configure-ac-remove-dead-code
[collectd.git]
/
src
/
utils_dns.c
diff --git
a/src/utils_dns.c
b/src/utils_dns.c
index
6abfde1
..
4c763a1
100644
(file)
--- a/
src/utils_dns.c
+++ b/
src/utils_dns.c
@@
-40,10
+40,6
@@
#include "plugin.h"
#include "common.h"
#include "plugin.h"
#include "common.h"
-#if HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-
#if HAVE_NET_IF_ARP_H
# include <net/if_arp.h>
#endif
#if HAVE_NET_IF_ARP_H
# include <net/if_arp.h>
#endif
@@
-305,7
+301,7
@@
rfc1035NameUnpack(const char *buf, size_t sz, off_t * off, char *name, size_t ns
if (ns <= 0)
return 4; /* probably compression loop */
do {
if (ns <= 0)
return 4; /* probably compression loop */
do {
- if ((*off) >=
sz
)
+ if ((*off) >=
((off_t) sz)
)
break;
c = *(buf + (*off));
if (c > 191) {
break;
c = *(buf + (*off));
if (c > 191) {
@@
-317,11
+313,11
@@
rfc1035NameUnpack(const char *buf, size_t sz, off_t * off, char *name, size_t ns
s = ntohs(s);
(*off) += sizeof(s);
/* Sanity check */
s = ntohs(s);
(*off) += sizeof(s);
/* Sanity check */
- if ((*off) >=
sz
)
+ if ((*off) >=
((off_t) sz)
)
return 1; /* message too short */
ptr = s & 0x3FFF;
/* Make sure the pointer is inside this message */
return 1; /* message too short */
ptr = s & 0x3FFF;
/* Make sure the pointer is inside this message */
- if (ptr >=
sz
)
+ if (ptr >=
((off_t) sz)
)
return 2; /* bad compression ptr */
if (ptr < DNS_MSG_HDR_SZ)
return 2; /* bad compression ptr */
return 2; /* bad compression ptr */
if (ptr < DNS_MSG_HDR_SZ)
return 2; /* bad compression ptr */
@@
-355,7
+351,7
@@
rfc1035NameUnpack(const char *buf, size_t sz, off_t * off, char *name, size_t ns
if (no > 0)
*(name + no - 1) = '\0';
/* make sure we didn't allow someone to overflow the name buffer */
if (no > 0)
*(name + no - 1) = '\0';
/* make sure we didn't allow someone to overflow the name buffer */
- assert(no <=
ns
);
+ assert(no <=
((off_t) ns)
);
return 0;
}
return 0;
}