Skip to content

Commit 3a39483

Browse files
committed
Added null check for 'stmt_info->first_comment' before accessing it during 'PROCESSING_STMT_EXECUTE' #3427
1 parent adb5ed6 commit 3a39483

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/MySQL_Session.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -4443,7 +4443,9 @@ int MySQL_Session::handler() {
44434443
// NOTE: Update 'first_comment' with the the from the retrieved
44444444
// 'stmt_info' from the found prepared statement. 'CurrentQuery' requires its
44454445
// own copy of 'first_comment' because it will later be free by 'QueryInfo::end'.
4446-
CurrentQuery.QueryParserArgs.first_comment=strdup(stmt_info->first_comment);
4446+
if (stmt_info->first_comment) {
4447+
CurrentQuery.QueryParserArgs.first_comment=strdup(stmt_info->first_comment);
4448+
}
44474449
previous_status.push(PROCESSING_STMT_EXECUTE);
44484450
NEXT_IMMEDIATE(PROCESSING_STMT_PREPARE);
44494451
if (CurrentQuery.stmt_global_id!=stmt_info->statement_id) {

0 commit comments

Comments
 (0)