Changeset 94082 in vbox for trunk/src/libs/openssl-3.0.1/crypto/bio/bf_buff.c
- Timestamp:
- Mar 3, 2022 7:17:34 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150325
- 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 12 12 /vendor/openssl/1.1.1c:131722-131725 13 13 /vendor/openssl/1.1.1k:145841-145843 14 /vendor/openssl/3.0.1:150323-150324 15 /vendor/openssl/current:147554-150322
-
- Property svn:mergeinfo
-
trunk/src/libs/openssl-3.0.1/crypto/bio/bf_buff.c
r91772 r94082 1 1 /* 2 * Copyright 1995-20 16The OpenSSL Project Authors. All Rights Reserved.2 * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. 3 3 * 4 * Licensed under the OpenSSL license(the "License"). You may not use4 * Licensed under the Apache License 2.0 (the "License"). You may not use 5 5 * this file except in compliance with the License. You can obtain a copy 6 6 * in the file LICENSE in the source distribution or at … … 26 26 BIO_TYPE_BUFFER, 27 27 "buffer", 28 /* TODO: Convert to new style write function */29 28 bwrite_conv, 30 29 buffer_write, 31 /* TODO: Convert to new style read function */32 30 bread_conv, 33 31 buffer_read, … … 290 288 case BIO_C_SET_BUFF_READ_DATA: 291 289 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); 293 293 if (p1 == NULL) 294 294 goto malloc_error; … … 319 319 p2 = ctx->obuf; 320 320 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); 322 324 if (p1 == NULL) 323 325 goto malloc_error; 324 326 } 325 327 if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) { 326 p2 = OPENSSL_malloc(( int)num);328 p2 = OPENSSL_malloc((size_t)num); 327 329 if (p2 == NULL) { 328 330 if (p1 != ctx->ibuf) … … 405 407 return ret; 406 408 malloc_error: 407 BIOerr(BIO_F_BUFFER_CTRL, ERR_R_MALLOC_FAILURE);409 ERR_raise(ERR_LIB_BIO, ERR_R_MALLOC_FAILURE); 408 410 return 0; 409 411 } … … 411 413 static long buffer_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp) 412 414 { 413 long ret = 1;414 415 415 if (b->next_bio == NULL) 416 416 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); 423 418 } 424 419
Note:
See TracChangeset
for help on using the changeset viewer.