From 0df69faa6e4096d2d0d50c3c4384fe122e94c03e Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 5 Aug 2015 00:18:02 +0100 Subject: [PATCH] packStructValue: fix a overflow in NSEC packing --- msg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msg.go b/msg.go index ffc0733c..676bbd7e 100644 --- a/msg.go +++ b/msg.go @@ -785,7 +785,7 @@ 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 { + if off+2+int(length)+1 > lenmsg { return lenmsg, &Error{err: "overflow packing nsecx bitmap"} }