From 67adad3e08fe17d5f7e87468ea47aa76e1662255 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 25 Apr 2022 23:50:10 +0200 Subject: Update dependencies (#1813) --- vendor/go.mau.fi/whatsmeow/binary/node.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vendor/go.mau.fi/whatsmeow/binary/node.go') diff --git a/vendor/go.mau.fi/whatsmeow/binary/node.go b/vendor/go.mau.fi/whatsmeow/binary/node.go index e09550f0..f2273205 100644 --- a/vendor/go.mau.fi/whatsmeow/binary/node.go +++ b/vendor/go.mau.fi/whatsmeow/binary/node.go @@ -7,6 +7,10 @@ // Package binary implements encoding and decoding documents in WhatsApp's binary XML format. package binary +import ( + "fmt" +) + // Attrs is a type alias for the attributes of an XML element (Node). type Attrs = map[string]interface{} @@ -78,6 +82,8 @@ func Unmarshal(data []byte) (*Node, error) { n, err := r.readNode() if err != nil { return nil, err + } else if r.index != len(r.data) { + return n, fmt.Errorf("%d leftover bytes after decoding", len(r.data)-r.index) } return n, nil } -- cgit v1.2.3