Skip to content

Commit 63f416b

Browse files
committed
Fix pointer comparison
1 parent bc49464 commit 63f416b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sa/saro.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,11 @@ func (ssa *SQLStorageAuthorityRO) GetAuthorizations2(ctx context.Context, req *s
604604
// TODO(#8111): Consider reducing the volume of data in this map.
605605
authzModelMap := make(map[identifier.ACMEIdentifier]authzModel, len(authzModels))
606606
for _, am := range authzModels {
607-
if req.Profile != "" && am.CertificateProfileName != &req.Profile {
607+
if req.Profile != "" {
608608
// Don't return authzs whose profile doesn't match that requested.
609-
continue
609+
if am.CertificateProfileName != nil || *am.CertificateProfileName != req.Profile {
610+
continue
611+
}
610612
}
611613
// If there is an existing authorization in the map, only replace it with
612614
// one which has a "better" validation state (valid instead of pending).
@@ -798,9 +800,11 @@ func (ssa *SQLStorageAuthorityRO) GetValidAuthorizations2(ctx context.Context, r
798800
// TODO(#8111): Consider reducing the volume of data in this map.
799801
authzMap := make(map[identifier.ACMEIdentifier]authzModel, len(authzModels))
800802
for _, am := range authzModels {
801-
if req.Profile != "" && am.CertificateProfileName != &req.Profile {
803+
if req.Profile != "" {
802804
// Don't return authzs whose profile doesn't match that requested.
803-
continue
805+
if am.CertificateProfileName == nil || *am.CertificateProfileName != req.Profile {
806+
continue
807+
}
804808
}
805809
// If there is an existing authorization in the map only replace it with one
806810
// which has a later expiry.

0 commit comments

Comments
 (0)