File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -892,6 +892,7 @@ static OCSP_RESPONSE *parse_ocsp_resp(char *buf, int len)
892892/* Reads the response from the APR socket to a buffer, and parses the buffer to
893893 return the OCSP response */
894894#define BUFFER_SIZE 512
895+ #define OCSP_MAX_RESPONSE_SIZE 65536
895896static OCSP_RESPONSE * ocsp_get_resp (apr_pool_t * mp , apr_socket_t * sock )
896897{
897898 int buflen ;
@@ -914,7 +915,10 @@ static OCSP_RESPONSE *ocsp_get_resp(apr_pool_t *mp, apr_socket_t *sock)
914915 readlen = sizeof (tmpbuf );
915916 rv = apr_socket_recv (sock , tmpbuf , & readlen );
916917 if (rv == APR_SUCCESS ) { /* if we have read something .. we can put it in the buffer*/
917- if ((totalread + readlen ) >= buflen ) {
918+ if ((totalread + readlen ) > OCSP_MAX_RESPONSE_SIZE ) {
919+ apr_pool_destroy (p );
920+ return NULL ;
921+ } else if ((totalread + readlen ) >= buflen ) {
918922 buf = apr_xrealloc (buf , buflen , buflen * 2 , p );
919923 if (buf == NULL ) {
920924 apr_pool_destroy (p );
You can’t perform that action at this time.
0 commit comments