Skip to content

Commit 0e3c42d

Browse files
Avoid panicking when the contents of a CT poison extension are truncated (#478)
Co-authored-by: Phillip Stephens <phillip@cs.stanford.edu>
1 parent 74e8448 commit 0e3c42d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x509/x509.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ func parseCertificate(in *certificate) (*Certificate, error) {
21122112
return nil, err
21132113
}
21142114
} else if e.Id.Equal(oidExtensionCTPrecertificatePoison) {
2115-
if e.Value[0] == 5 && e.Value[1] == 0 {
2115+
if len(e.Value) == 2 && e.Value[0] == 5 && e.Value[1] == 0 {
21162116
out.IsPrecert = true
21172117
continue
21182118
} else {

0 commit comments

Comments
 (0)