Skip to content

Commit

Permalink
Added null check for 'stmt_info->first_comment' before accessing it d…
Browse files Browse the repository at this point in the history
…uring 'PROCESSING_STMT_EXECUTE' #3427
  • Loading branch information
JavierJF committed May 26, 2021
1 parent adb5ed6 commit 3a39483
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4443,7 +4443,9 @@ int MySQL_Session::handler() {
// NOTE: Update 'first_comment' with the the from the retrieved
// 'stmt_info' from the found prepared statement. 'CurrentQuery' requires its
// own copy of 'first_comment' because it will later be free by 'QueryInfo::end'.
CurrentQuery.QueryParserArgs.first_comment=strdup(stmt_info->first_comment);
if (stmt_info->first_comment) {
CurrentQuery.QueryParserArgs.first_comment=strdup(stmt_info->first_comment);
}
previous_status.push(PROCESSING_STMT_EXECUTE);
NEXT_IMMEDIATE(PROCESSING_STMT_PREPARE);
if (CurrentQuery.stmt_global_id!=stmt_info->statement_id) {
Expand Down

0 comments on commit 3a39483

Please sign in to comment.