Fix some malloc test crashs.
This isn't exhaustive. There are still failures in some tests which probably
ought to get C++'d first.
Change-Id: Iac58df9d98cdfd94603d54374a531b2559df64c3
Reviewed-on: https://boringssl-review.googlesource.com/4795
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index c0c430a..66a72a1 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -873,6 +873,7 @@
#define BIO_F_file_ctrl 115
#define BIO_F_file_read 116
#define BIO_F_mem_write 117
+#define BIO_F_BIO_printf 118
#define BIO_R_BAD_FOPEN_MODE 100
#define BIO_R_BROKEN_PIPE 101
#define BIO_R_CONNECT_ERROR 102
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
index f1469a0..7f5fe04 100644
--- a/include/openssl/cipher.h
+++ b/include/openssl/cipher.h
@@ -520,6 +520,9 @@
int (*cipher)(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
size_t inl);
+ /* cleanup, if non-NULL, releases memory associated with the context. It is
+ * called if |EVP_CTRL_INIT| succeeds. Note that |init| may not have been
+ * called at this point. */
void (*cleanup)(EVP_CIPHER_CTX *);
int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr);
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index cd41211..a7e49c9 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -239,8 +239,9 @@
OPENSSL_EXPORT const char *SSL_CIPHER_get_kx_name(const SSL_CIPHER *cipher);
/* SSL_CIPHER_get_rfc_name returns a newly-allocated string with the standard
- * name for |cipher|. For example, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256". The
- * caller is responsible for calling |OPENSSL_free| on the result. */
+ * name for |cipher| or NULL on error. For example,
+ * "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256". The caller is responsible for
+ * calling |OPENSSL_free| on the result. */
OPENSSL_EXPORT char *SSL_CIPHER_get_rfc_name(const SSL_CIPHER *cipher);
/* SSL_CIPHER_get_bits returns the strength, in bits, of |cipher|. If