size_t off;
struct Gns2DnsPending *gp;
struct GNUNET_CRYPTO_EcdsaPublicKey zone;
+ struct sockaddr_in v4;
+ struct sockaddr_in6 v6;
if (GNUNET_GNSRECORD_TYPE_GNS2DNS != rd[i].record_type)
continue;
}
/* check if 'ip' is already an IPv4/IPv6 address */
- if (GNUNET_OK ==
- GNUNET_DNSSTUB_add_dns_ip (ac->authority_info.dns_authority.dns_handle,
- ip))
+ if ( (1 == inet_pton (AF_INET,
+ ip,
+ &v4)) ||
+ (1 == inet_pton (AF_INET6,
+ ip,
+ &v6)) )
{
+ GNUNET_break (GNUNET_OK ==
+ GNUNET_DNSSTUB_add_dns_ip (ac->authority_info.dns_authority.dns_handle,
+ ip));
ac->authority_info.dns_authority.found = GNUNET_YES;
GNUNET_free (ip);
continue;
rec.data_size = htonl ((uint32_t) rd[i].data_size);
rec.record_type = htonl (rd[i].record_type);
rec.flags = htonl (rd[i].flags);
- if (off + sizeof (rec) > dest_size)
+ if ( (off + sizeof (rec) > dest_size) ||
+ (off + sizeof (rec) < off) )
{
GNUNET_break (0);
return -1;
&rec,
sizeof (rec));
off += sizeof (rec);
- if (off + rd[i].data_size > dest_size)
+ if ( (off + rd[i].data_size > dest_size) ||
+ (off + rd[i].data_size < off) )
{
GNUNET_break (0);
return -1;
off = 0;
for (unsigned int i=0;i<rd_count;i++)
{
- if (off + sizeof (rec) > len)
+ if ( (off + sizeof (rec) > len) ||
+ (off + sizeof (rec) < off) )
{
GNUNET_break_op (0);
return GNUNET_SYSERR;
dest[i].record_type = ntohl (rec.record_type);
dest[i].flags = ntohl (rec.flags);
off += sizeof (rec);
- if (off + dest[i].data_size > len)
+ if ( (off + dest[i].data_size > len) ||
+ (off + dest[i].data_size < off) )
{
GNUNET_break_op (0);
return GNUNET_SYSERR;