if (0 != x)
return 0;
if ('\0' == qh.qname[0])
- strcpy(qh.qname, ".");
+ strncpy (qh.qname, ".", sizeof (qh.qname));
while ((t = strchr(qh.qname, '\n')))
*t = ' ';
while ((t = strchr(qh.qname, '\r')))
handle_ipv6 (struct ip6_hdr *ipv6, int len)
{
char buf[PCAP_SNAPLEN];
- int offset;
+ unsigned int offset;
int nexthdr;
struct in6_addr s_addr;
struct in6_addr d_addr;
uint16_t payload_len;
+ if (0 > len)
+ return (0);
+
offset = sizeof (struct ip6_hdr);
nexthdr = ipv6->ip6_nxt;
s_addr = ipv6->ip6_src;
uint16_t ext_hdr_len;
/* Catch broken packets */
- if ((offset + sizeof (struct ip6_ext)) > len)
+ if ((offset + sizeof (struct ip6_ext)) > (unsigned int)len)
return (0);
/* Cannot handle fragments. */
} /* while */
/* Catch broken and empty packets */
- if (((offset + payload_len) > len)
+ if (((offset + payload_len) > (unsigned int)len)
|| (payload_len == 0)
|| (payload_len > PCAP_SNAPLEN))
return (0);
} *hdr;
uint16_t etype;
- if (len < sizeof (struct sll_header))
+ if ((0 > len) || ((unsigned int)len < sizeof (struct sll_header)))
return (0);
hdr = (struct sll_header *) pkt;
{
static char buf[32];
switch (t) {
-#if (defined (__NAMESER)) && (__NAMESER >= 19991006)
+#if (defined (__NAMESER)) && (__NAMESER >= 19991001)
case ns_t_a: return ("A");
case ns_t_ns: return ("NS");
case ns_t_md: return ("MD");
case ns_t_dname: return ("DNAME");
case ns_t_sink: return ("SINK");
case ns_t_opt: return ("OPT");
+# if __NAMESER >= 19991006
case ns_t_tsig: return ("TSIG");
+# endif
case ns_t_ixfr: return ("IXFR");
case ns_t_axfr: return ("AXFR");
case ns_t_mailb: return ("MAILB");