Ignore:
Timestamp:
Aug 7, 2014, 8:25:37 PM (11 years ago)
Author:
dmik
Message:

openssl: Merge version 1.0.0n from vendor to trunk.

Location:
openssl/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • openssl/trunk

  • TabularUnified openssl/trunk/crypto/ocsp/ocsp_ht.c

    r150 r808  
    159159        OCSP_REQ_CTX *rctx;
    160160        rctx = OPENSSL_malloc(sizeof(OCSP_REQ_CTX));
     161        if (!rctx)
     162                return NULL;
    161163        rctx->state = OHS_ERROR;
    162164        rctx->mem = BIO_new(BIO_s_mem());
     
    168170                rctx->iobuflen = OCSP_MAX_LINE_LEN;
    169171        rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
    170         if (!rctx->iobuf)
    171                 return 0;
     172        if (!rctx->mem || !rctx->iobuf)
     173                goto err;
    172174        if (!path)
    173175                path = "/";
    174176
    175177        if (BIO_printf(rctx->mem, post_hdr, path) <= 0)
    176                 return 0;
     178                goto err;
    177179
    178180        if (req && !OCSP_REQ_CTX_set1_req(rctx, req))
    179                 return 0;
     181                goto err;
    180182
    181183        return rctx;
     184        err:
     185        OCSP_REQ_CTX_free(rctx);
     186        return NULL;
    182187        }
    183188
     
    398403
    399404                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.
    402408                 */
    403409                n = BIO_get_mem_data(rctx->mem, &p);
    404                 if (n < 6)
     410                if (n < 2)
    405411                        goto next_io;
    406412
     
    415421                if (*p & 0x80)
    416422                        {
     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;
    417428                        n = *p & 0x7F;
    418429                        /* Not NDEF or excessive length */
     
    485496        ctx = OCSP_sendreq_new(b, path, req, -1);
    486497
     498        if (!ctx)
     499                return NULL;
     500
    487501        do
    488502                {
Note: See TracChangeset for help on using the changeset viewer.