X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fdnsproxy.c;h=5c4099bdfafd7be9a55617588abe708d9197c2c0;hb=3ba2d070a7349a0f35e74be9eb995d43db5e7a7c;hp=6a9b1381373a13b7000aabe212bd0a87db11de20;hpb=6636320dc4c4b3254631098b4e748f0e38090344;p=framework%2Fconnectivity%2Fconnman.git diff --git a/src/dnsproxy.c b/src/dnsproxy.c index 6a9b138..5c4099b 100644 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -1551,13 +1551,13 @@ static int forward_dns_reply(unsigned char *reply, int reply_len, int protocol, */ ptr = reply + offset + sizeof(struct domain_hdr); host_len = *ptr; - domain_len = strlen((const char *)ptr) - host_len - 1; + domain_len = strlen((const char *)ptr + host_len + 1); /* - * remove the domain name and replaced it by the end + * remove the domain name and replace it by the end * of reply. */ - memmove(ptr + host_len + 1, + memcpy(ptr + host_len + 1, ptr + host_len + domain_len + 1, reply_len - (ptr - reply + domain_len));