diff options
author | Wim <wim@42.be> | 2022-04-25 23:50:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 23:50:10 +0200 |
commit | 67adad3e08fe17d5f7e87468ea47aa76e1662255 (patch) | |
tree | 91314fac90d39254e66ae794decfcd21c10a7b20 /vendor/go.mau.fi/whatsmeow/binary/node.go | |
parent | 2fca3c756373577eab4e0120ccce62eecc1f5ad8 (diff) | |
download | matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.tar.gz matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.tar.bz2 matterbridge-msglm-67adad3e08fe17d5f7e87468ea47aa76e1662255.zip |
Update dependencies (#1813)
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/binary/node.go')
-rw-r--r-- | vendor/go.mau.fi/whatsmeow/binary/node.go | 6 |
1 files changed, 6 insertions, 0 deletions
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 } |