dnsproxy: Do not copy two extra bytes if using TCP
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Wed, 23 Nov 2011 13:31:39 +0000 (15:31 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 24 Nov 2011 00:21:48 +0000 (01:21 +0100)
src/dnsproxy.c

index 24aad91..21512c6 100644 (file)
@@ -387,7 +387,7 @@ static int ns_resolv(struct server_data *server, struct request_data *req,
 
                memcpy(alt + offset + altlen,
                        request + offset + altlen - domlen,
-                               req->request_len - altlen + domlen);
+                               req->request_len - altlen - offset + domlen);
 
                if (server->protocol == IPPROTO_TCP) {
                        int req_len = req->request_len + domlen - 2;