Skip to content

Commit c1f9398

Browse files
committed
fixup! Implement OCSP responder
1 parent b2750c8 commit c1f9398

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

examples/ocsp_responder/ocsp_responder.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ static int SendHttpResponse(SOCKET_T clientfd, const byte* ocspResp, int ocspRes
607607
int headerLen;
608608
int sent;
609609

610-
headerLen = snprintf(header, sizeof(header),
610+
headerLen = XSNPRINTF(header, sizeof(header),
611611
"HTTP/1.0 200 OK\r\n"
612612
"Content-Type: application/ocsp-response\r\n"
613613
"Content-Length: %d\r\n"
@@ -657,15 +657,15 @@ static int SendHttpError(SOCKET_T clientfd, int statusCode, const char* statusMs
657657
int len;
658658
int sent;
659659

660-
len = snprintf(response, sizeof(response),
660+
len = XSNPRINTF(response, sizeof(response),
661661
"HTTP/1.0 %d %s\r\n"
662662
"Content-Type: text/plain\r\n"
663663
"Content-Length: %d\r\n"
664664
"Connection: close\r\n"
665665
"\r\n"
666666
"%s", statusCode, statusMsg, (int)XSTRLEN(statusMsg), statusMsg);
667667

668-
/* Handle snprintf error or truncation to avoid sending out-of-bounds data. */
668+
/* Handle XSNPRINTF error or truncation to avoid sending out-of-bounds data. */
669669
if (len < 0 || len >= (int)sizeof(response)) {
670670
LOG_ERROR("HTTP error response truncated\n");
671671
return -1;

0 commit comments

Comments
 (0)