Explorar el Código

Fix dns truncate

Mahdi hace 2 semanas
padre
commit
886be6414d
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      dns/client_truncate.go

+ 1 - 2
dns/client_truncate.go

@@ -15,8 +15,7 @@ func TruncateDNSMessage(request *dns.Msg, response *dns.Msg, headroom int) (*buf
 	}
 	responseLen := response.Len()
 	if responseLen > maxLen {
-		copyResponse := *response
-		response = &copyResponse
+		response = response.Copy()
 		response.Truncate(maxLen)
 	}
 	buffer := buf.NewSize(headroom*2 + 1 + responseLen)