VirtualBox

Ignore:
Timestamp:
Mar 3, 2022 7:17:34 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
150325
Message:

libs/openssl-3.0.1: started applying and adjusting our OpenSSL changes to 3.0.1. bugref:10128

Location:
trunk/src/libs/openssl-3.0.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/openssl-3.0.1

    • Property svn:mergeinfo
      •  

        old new  
        1212/vendor/openssl/1.1.1c:131722-131725
        1313/vendor/openssl/1.1.1k:145841-145843
         14/vendor/openssl/3.0.1:150323-150324
         15/vendor/openssl/current:147554-150322
  • trunk/src/libs/openssl-3.0.1/crypto/bio/bf_buff.c

    r91772 r94082  
    11/*
    2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
     2 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
    33 *
    4  * Licensed under the OpenSSL license (the "License").  You may not use
     4 * Licensed under the Apache License 2.0 (the "License").  You may not use
    55 * this file except in compliance with the License.  You can obtain a copy
    66 * in the file LICENSE in the source distribution or at
     
    2626    BIO_TYPE_BUFFER,
    2727    "buffer",
    28     /* TODO: Convert to new style write function */
    2928    bwrite_conv,
    3029    buffer_write,
    31     /* TODO: Convert to new style read function */
    3230    bread_conv,
    3331    buffer_read,
     
    290288    case BIO_C_SET_BUFF_READ_DATA:
    291289        if (num > ctx->ibuf_size) {
    292             p1 = OPENSSL_malloc((int)num);
     290            if (num <= 0)
     291                return 0;
     292            p1 = OPENSSL_malloc((size_t)num);
    293293            if (p1 == NULL)
    294294                goto malloc_error;
     
    319319        p2 = ctx->obuf;
    320320        if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) {
    321             p1 = OPENSSL_malloc((int)num);
     321            if (num <= 0)
     322                return 0;
     323            p1 = OPENSSL_malloc((size_t)num);
    322324            if (p1 == NULL)
    323325                goto malloc_error;
    324326        }
    325327        if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) {
    326             p2 = OPENSSL_malloc((int)num);
     328            p2 = OPENSSL_malloc((size_t)num);
    327329            if (p2 == NULL) {
    328330                if (p1 != ctx->ibuf)
     
    405407    return ret;
    406408 malloc_error:
    407     BIOerr(BIO_F_BUFFER_CTRL, ERR_R_MALLOC_FAILURE);
     409    ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE);
    408410    return 0;
    409411}
     
    411413static long buffer_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
    412414{
    413     long ret = 1;
    414 
    415415    if (b->next_bio == NULL)
    416416        return 0;
    417     switch (cmd) {
    418     default:
    419         ret = BIO_callback_ctrl(b->next_bio, cmd, fp);
    420         break;
    421     }
    422     return ret;
     417    return BIO_callback_ctrl(b->next_bio, cmd, fp);
    423418}
    424419
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette