diff --git a/src/protocol/MySQLMessage.cc b/src/protocol/MySQLMessage.cc index 47a2c067..83a3a2b3 100644 --- a/src/protocol/MySQLMessage.cc +++ b/src/protocol/MySQLMessage.cc @@ -17,7 +17,6 @@ Wu Jiaxu (wujiaxu@sogou-inc.com) */ -#include #include #include #include @@ -573,6 +572,8 @@ int MySQLRSAAuthRequest::encode(struct iovec vectors[], int max) rsa = PEM_read_bio_RSA_PUBKEY(bio, NULL, NULL, NULL); BIO_free(bio); + if (!rsa) + return -1; EVP_PKEY_CTX *pkey_ctx; EVP_PKEY *pkey;