Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix GH-12791: Possible dereference of NULL in MySQLnd debug code
  • Loading branch information
ndossche committed Nov 27, 2023
commit ed1dad16e46cd565dabd09faa8061fe2da9b0208
2 changes: 1 addition & 1 deletion ext/mysqlnd/mysqlnd_result.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,8 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c
UPSERT_STATUS_GET_SERVER_STATUS(conn->upsert_status));
free_end:
PACKET_FREE(&row_packet);
DBG_INF_FMT("rows=%llu", (unsigned long long)set->row_count);
end:
DBG_INF_FMT("rows=%llu", (unsigned long long)result->stored_data->row_count);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When set is NULL and you get to this point with goto, isn't result->stored_data also NULL?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the issue.
But by moving it into free_end, we only reach the line if it is not NULL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, sorry...I read the wrong line!

DBG_RETURN(ret);
}
/* }}} */
Expand Down