Skip to content

Commit

Permalink
use GUARD_PTR for null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed Jul 17, 2024
1 parent 768db7d commit f9107fd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crypto/ocsp/ocsp_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@
// SPDX-License-Identifier: Apache-2.0 OR ISC
// Modifications Copyright Amazon.com, Inc. or its affiliates.

#include "../internal.h"
#include "internal.h"

int OCSP_request_onereq_count(OCSP_REQUEST *req) {
GUARD_PTR(req);
GUARD_PTR(req->tbsRequest);
return (int)sk_OCSP_ONEREQ_num(req->tbsRequest->requestList);
}

OCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i) {
GUARD_PTR(req);
return sk_OCSP_ONEREQ_value(req->tbsRequest->requestList, i);
}

Expand All @@ -42,16 +46,15 @@ int OCSP_id_get0_info(ASN1_OCTET_STRING **nameHash, ASN1_OBJECT **algor,
}

int OCSP_request_is_signed(OCSP_REQUEST *req) {
GUARD_PTR(req);
if (req->optionalSignature != NULL) {
return 1;
}
return 0;
}

OCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one) {
if(one == NULL) {
return NULL;
}
GUARD_PTR(one);
return one->reqCert;
}

Expand Down

0 comments on commit f9107fd

Please sign in to comment.