Skip to content

Commit 0649aa5

Browse files
committed
Fix truncate message
1 parent ec88d3d commit 0649aa5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

client_truncate.go

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ func TruncateDNSMessage(request *dns.Msg, response *dns.Msg, headroom int) (*buf
1515
}
1616
responseLen := response.Len()
1717
if responseLen > maxLen {
18+
responseCopy := *response
19+
response = &responseCopy
1820
response.Truncate(maxLen)
1921
}
2022
buffer := buf.NewSize(headroom*2 + 1 + responseLen)

0 commit comments

Comments
 (0)