From e636c10380ab8176b3f31b14fb3e8ce4a7558578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ask=20Bj=C3=B8rn=20Hansen?= Date: Mon, 30 Dec 2019 05:42:48 -0800 Subject: [PATCH] Support the zero length EDNS0 EXPIRE option (#1065) * Support the zero length EDNS0 EXPIRE option * EDNS0 EXPIRE: Just reference the RFC, don't link to it Co-Authored-By: Miek Gieben Co-authored-by: Miek Gieben --- edns.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/edns.go b/edns.go index d244f7c6..04808d57 100644 --- a/edns.go +++ b/edns.go @@ -543,6 +543,10 @@ func (e *EDNS0_EXPIRE) pack() ([]byte, error) { } func (e *EDNS0_EXPIRE) unpack(b []byte) error { + if len(b) == 0 { + // zero-length EXPIRE query, see RFC 7314 Section 2 + return nil + } if len(b) < 4 { return ErrBuf }