---
title: "Bug in dns.c?"
url: "https://maker.wiznet.io/forum/10880"
markdown_url: "https://maker.wiznet.io/forum/10880/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Eerik"
created: "2015-03-03T08:22:49+09:00"
last_activity: "2017-05-04T08:35:08+09:00"
language: "en"
views: 730
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# Bug in dns.c?

## Question

Asked by Eerik on 2015-03-03 in Ethernet Chips.

My compiler reports

> W5500/Internet/DNS/dns.c:342:25: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]

The code it refers to:

```
/*
 *              PARSE THE DNS REPLY
 *
 * Description : This function parses the reply message from DNS server.
 * Arguments   : dhdr - is a pointer to the header for DNS message
 *               buf  - is a pointer to the reply message.
 *               len  - is the size of reply message.
 * Returns     : -1 - Domain name lenght is too big 
 *                0 - Fail (Timout or parse error)
 *                1 - Success, 
 */
int8_t parseDNSMSG(struct dhdr * pdhdr, uint8_t * pbuf, uint8_t * ip_from_dns)
{
	uint16_t tmp;
	uint16_t i;
	uint8_t * msg;
	uint8_t * cp;

	msg = pbuf;
	memset(pdhdr, 0, sizeof(pdhdr));
```

Should it be like this?

```
memset(pdhdr, 0, sizeof(dhdr));
```

## Replies

### Reply 1 by Ricky, 2015-03-30

hi.

the difference between “memset(pdhdr, 0, sizeof(dhdr));” and “memset(pdhdr, 0, sizeof(pdhdr));”, there is almost no effect on the system.

but, we will check that and modified.

---

Source: https://maker.wiznet.io/forum/10880
