{
BIO_CORE_GLOBALS *bcgbl = get_globals(bio->libctx);
- if (bcgbl->c_bio_read_ex == NULL)
+ if (bcgbl == NULL || bcgbl->c_bio_read_ex == NULL)
return 0;
return bcgbl->c_bio_read_ex(BIO_get_data(bio), data, data_len, bytes_read);
}
{
BIO_CORE_GLOBALS *bcgbl = get_globals(bio->libctx);
- if (bcgbl->c_bio_write_ex == NULL)
+ if (bcgbl == NULL || bcgbl->c_bio_write_ex == NULL)
return 0;
return bcgbl->c_bio_write_ex(BIO_get_data(bio), data, data_len, written);
}
{
BIO_CORE_GLOBALS *bcgbl = get_globals(bio->libctx);
- if (bcgbl->c_bio_ctrl == NULL)
+ if (bcgbl == NULL || bcgbl->c_bio_ctrl == NULL)
return -1;
return bcgbl->c_bio_ctrl(BIO_get_data(bio), cmd, num, ptr);
}
{
BIO_CORE_GLOBALS *bcgbl = get_globals(bio->libctx);
- if (bcgbl->c_bio_gets == NULL)
+ if (bcgbl == NULL || bcgbl->c_bio_gets == NULL)
return -1;
return bcgbl->c_bio_gets(BIO_get_data(bio), buf, size);
}
{
BIO_CORE_GLOBALS *bcgbl = get_globals(bio->libctx);
- if (bcgbl->c_bio_puts == NULL)
+ if (bcgbl == NULL || bcgbl->c_bio_puts == NULL)
return -1;
return bcgbl->c_bio_puts(BIO_get_data(bio), str);
}
{
BIO_CORE_GLOBALS *bcgbl = get_globals(bio->libctx);
+ if (bcgbl == NULL)
+ return 0;
+
BIO_set_init(bio, 0);
bcgbl->c_bio_free(BIO_get_data(bio));
BIO_CORE_GLOBALS *bcgbl = get_globals(libctx);
/* Check the library context has been initialised with the callbacks */
- if (bcgbl->c_bio_write_ex == NULL && bcgbl->c_bio_read_ex == NULL)
+ if (bcgbl == NULL || (bcgbl->c_bio_write_ex == NULL && bcgbl->c_bio_read_ex == NULL))
return NULL;
if ((outbio = BIO_new_ex(libctx, BIO_s_core())) == NULL)
{
BIO_CORE_GLOBALS *bcgbl = get_globals(libctx);
+ if (bcgbl == NULL)
+ return 0;
+
for (; fns->function_id != 0; fns++) {
switch (fns->function_id) {
case OSSL_FUNC_BIO_READ_EX: