mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Fix potential leaks when writing to BIO fails
When the BIO is created but writing fails, these can leak. Closes GH-18186.
This commit is contained in:
parent
90f582b188
commit
29f96fb1f1
2 changed files with 5 additions and 4 deletions
1
NEWS
1
NEWS
|
@ -18,6 +18,7 @@ PHP NEWS
|
|||
- OpenSSL:
|
||||
. Fix memory leak in openssl_sign() when passing invalid algorithm.
|
||||
(nielsdos)
|
||||
. Fix potential leaks when writing to BIO fails. (nielsdos)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug GH-18145 (php8ts crashes in php_clear_stat_cache()).
|
||||
|
|
|
@ -5742,8 +5742,8 @@ PHP_FUNCTION(openssl_pkcs7_read)
|
|||
BIO_get_mem_ptr(bio_out, &bio_buf);
|
||||
ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length);
|
||||
add_index_zval(zout, i, &zcert);
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5757,8 +5757,8 @@ PHP_FUNCTION(openssl_pkcs7_read)
|
|||
BIO_get_mem_ptr(bio_out, &bio_buf);
|
||||
ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length);
|
||||
add_index_zval(zout, i, &zcert);
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6383,8 +6383,8 @@ PHP_FUNCTION(openssl_cms_read)
|
|||
BIO_get_mem_ptr(bio_out, &bio_buf);
|
||||
ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length);
|
||||
add_index_zval(zout, i, &zcert);
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6398,8 +6398,8 @@ PHP_FUNCTION(openssl_cms_read)
|
|||
BIO_get_mem_ptr(bio_out, &bio_buf);
|
||||
ZVAL_STRINGL(&zcert, bio_buf->data, bio_buf->length);
|
||||
add_index_zval(zout, i, &zcert);
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
BIO_free(bio_out);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue