Changeset 808 for openssl/trunk/crypto/ocsp/ocsp_ht.c
- Timestamp:
- Aug 7, 2014, 8:25:37 PM (11 years ago)
- Location:
- openssl/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
openssl/trunk ¶
- Property svn:mergeinfo changed
/openssl/vendor/1.0.0-current (added) merged: 799-800,804 /openssl/vendor/1.0.0n (added) merged: 807
- Property svn:mergeinfo changed
-
TabularUnified openssl/trunk/crypto/ocsp/ocsp_ht.c ¶
r150 r808 159 159 OCSP_REQ_CTX *rctx; 160 160 rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX)); 161 if (!rctx) 162 return NULL; 161 163 rctx->state = OHS_ERROR; 162 164 rctx->mem = BIO_new(BIO_s_mem()); … … 168 170 rctx->iobuflen = OCSP_MAX_LINE_LEN; 169 171 rctx->iobuf = OPENSSL_malloc(rctx->iobuflen); 170 if (!rctx-> iobuf)171 return 0;172 if (!rctx->mem || !rctx->iobuf) 173 goto err; 172 174 if (!path) 173 175 path = "/"; 174 176 175 177 if (BIO_printf(rctx->mem, post_hdr, path) <= 0) 176 return 0;178 goto err; 177 179 178 180 if (req && !OCSP_REQ_CTX_set1_req(rctx, req)) 179 return 0;181 goto err; 180 182 181 183 return rctx; 184 err: 185 OCSP_REQ_CTX_free(rctx); 186 return NULL; 182 187 } 183 188 … … 398 403 399 404 case OHS_ASN1_HEADER: 400 /* Now reading ASN1 header: can read at least 6 bytes which 401 * is more than enough for any valid ASN1 SEQUENCE header 405 /* Now reading ASN1 header: can read at least 2 bytes which 406 * is enough for ASN1 SEQUENCE header and either length field 407 * or at least the length of the length field. 402 408 */ 403 409 n = BIO_get_mem_data(rctx->mem, &p); 404 if (n < 6)410 if (n < 2) 405 411 goto next_io; 406 412 … … 415 421 if (*p & 0x80) 416 422 { 423 /* If MSB set on initial length octet we can now 424 * always read 6 octets: make sure we have them. 425 */ 426 if (n < 6) 427 goto next_io; 417 428 n = *p & 0x7F; 418 429 /* Not NDEF or excessive length */ … … 485 496 ctx = OCSP_sendreq_new(b, path, req, -1); 486 497 498 if (!ctx) 499 return NULL; 500 487 501 do 488 502 {
Note:
See TracChangeset
for help on using the changeset viewer.