Remove tainted zeroing from packDomainName

With the label copying now moved after the compression, the msg buffer
will no longer be tainted and need clearing.
This commit is contained in:
Tom Thorogood 2018-11-26 15:02:17 +10:30
parent 8995ae83e3
commit 36a30d2e58
No known key found for this signature in database
GPG Key ID: 86C63CDA416C6D2F
1 changed files with 0 additions and 6 deletions

6
msg.go
View File

@ -307,12 +307,6 @@ loop:
}
// If we did compression and we find something add the pointer here
if pointer != -1 {
// Clear the msg buffer after the pointer location, otherwise
// packDataNsec writes the wrong data to msg.
tainted := msg[nameoffset:off]
for i := range tainted {
tainted[i] = 0
}
// We have two bytes (14 bits) to put the pointer in
// if msg == nil, we will never do compression
binary.BigEndian.PutUint16(msg[nameoffset:], uint16(pointer^0xC000))