I'm reasonably sure BIO_C_GET_BUF_MEM_PTR is supposed to return a pointer to a BUF_MEM structure. Assuming that's not feasible, it's probably best to just assert() + abort() here.