From: Mateusz Poliwczak Date: Thu, 23 Mar 2023 10:57:36 +0000 (+0000) Subject: crypto/x509: remove unnecessary !Empty() check X-Git-Tag: go1.21rc1~1165 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7ec2e8442415bd7d15819cf2aeba3a678223c81c;p=gostls13.git crypto/x509: remove unnecessary !Empty() check This check is already done by PeekASN1Tag. Change-Id: Ieba0e35548f7f99bce689d29adaea6b8e471cc70 GitHub-Last-Rev: b4ef3dcc2307839cb7575cf29c3e6445b6a7520e GitHub-Pull-Request: golang/go#59197 Reviewed-on: https://go-review.googlesource.com/c/go/+/478835 Reviewed-by: Roland Shoemaker Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: Filippo Valsorda TryBot-Result: Gopher Robot Auto-Submit: Ian Lance Taylor --- diff --git a/src/crypto/x509/parser.go b/src/crypto/x509/parser.go index 5a1819841d..6695212a0b 100644 --- a/src/crypto/x509/parser.go +++ b/src/crypto/x509/parser.go @@ -342,7 +342,7 @@ func parseBasicConstraintsExtension(der cryptobyte.String) (bool, int, error) { } } maxPathLen := -1 - if !der.Empty() && der.PeekASN1Tag(cryptobyte_asn1.INTEGER) { + if der.PeekASN1Tag(cryptobyte_asn1.INTEGER) { if !der.ReadASN1Integer(&maxPathLen) { return false, 0, errors.New("x509: invalid basic constraints") }