summaryrefslogtreecommitdiffstats
path: root/ber.go
diff options
context:
space:
mode:
authorMichael Mitton <mmitton@gmail.com>2011-02-18 19:15:48 +0100
committerMichael Mitton <mmitton@gmail.com>2011-02-18 19:15:48 +0100
commit3df1c6c2807ff5258506c928cc3cb6862b704b39 (patch)
tree6122f88a23158fcf020883a4c35314680f2bbc5c /ber.go
parentfirst commit (diff)
downloadasn1-ber-3df1c6c2807ff5258506c928cc3cb6862b704b39.tar
asn1-ber-3df1c6c2807ff5258506c928cc3cb6862b704b39.tar.gz
asn1-ber-3df1c6c2807ff5258506c928cc3cb6862b704b39.tar.bz2
asn1-ber-3df1c6c2807ff5258506c928cc3cb6862b704b39.tar.lz
asn1-ber-3df1c6c2807ff5258506c928cc3cb6862b704b39.tar.xz
asn1-ber-3df1c6c2807ff5258506c928cc3cb6862b704b39.tar.zst
asn1-ber-3df1c6c2807ff5258506c928cc3cb6862b704b39.zip
Diffstat (limited to 'ber.go')
-rw-r--r--ber.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ber.go b/ber.go
index 5e2fc0d..058fd48 100644
--- a/ber.go
+++ b/ber.go
@@ -351,7 +351,7 @@ func (p *Packet) Bytes() []byte {
var out bytes.Buffer
out.Write( []byte { p.ClassType | p.TagType | p.Tag } )
packet_length := EncodeInteger( p.DataLength() )
- if len( packet_length ) > 1 {
+ if p.DataLength() > 127 || len( packet_length ) > 1 {
out.Write( []byte { byte( len( packet_length ) | 128 ) } )
out.Write( packet_length )
} else {