Allocate just enough space
Remove the len()*2, and replace it with len()+1. The current len() impl. of the types is good enough to be more precise.
This commit is contained in:
parent
70ee966106
commit
6b32a711e9
|
@ -685,7 +685,7 @@ func rawSignatureData(rrset []RR, s *RRSIG) (buf []byte, err error) {
|
|||
x.Target = strings.ToLower(x.Target)
|
||||
}
|
||||
// 6.2. Canonical RR Form. (5) - origTTL
|
||||
wire := make([]byte, r1.len()*2) // TODO(mg): *2 ?
|
||||
wire := make([]byte, r1.len()+1) // +1 to be safe(r)
|
||||
off, err1 := PackRR(r1, wire, 0, nil, false)
|
||||
if err1 != nil {
|
||||
return nil, err1
|
||||
|
|
Loading…
Reference in New Issue