Overflow fixes
This commit is contained in:
parent
283d984261
commit
f25584e94e
|
@ -515,7 +515,7 @@ func rawSignatureData(rrset RRset, s *RR_RRSIG) (buf []byte) {
|
|||
|
||||
// 6.2. Canonical RR Form. (5) - origTTL
|
||||
ttl := h.Ttl
|
||||
wire := make([]byte, r.Len())
|
||||
wire := make([]byte, r.Len()*2)
|
||||
h.Ttl = s.OrigTtl
|
||||
off, ok1 := packRR(r, wire, 0, nil, false)
|
||||
if !ok1 {
|
||||
|
|
4
msg.go
4
msg.go
|
@ -438,6 +438,10 @@ func packStructValue(val reflect.Value, msg []byte, off int, compression map[str
|
|||
}
|
||||
length = (t - window*256) / 8
|
||||
bit := t - (window * 256) - (length * 8)
|
||||
if off+2+int(length) > lenmsg {
|
||||
println("dns: overflow packing NSECx bitmap")
|
||||
return lenmsg, false
|
||||
}
|
||||
|
||||
// Setting the window #
|
||||
msg[off] = byte(window)
|
||||
|
|
Loading…
Reference in New Issue