From: Alex G. (JIRA) <tr...@fi...> - 2015-07-01 09:39:48
|
Possible incorrect usage of WeakReference.Target in method FirebirdSql.Data.FirebirdClient.FbConnectionInternal.TransactionUpdated ---------------------------------------------------------------------------------------------------------------------------------- Key: DNET-619 URL: http://tracker.firebirdsql.org/browse/DNET-619 Project: .NET Data provider Issue Type: Bug Affects Versions: 4.6.4.0, 4.1.0.0 Environment: Windows 7 prof, sp1, CPU i5-3550, mem 8 GiB Reporter: Alex Gaysinskiy Assignee: Jiri Cincura Implementation of FirebirdSql.Data.FirebirdClient.FbConnectionInternal.TransactionUpdated function (FirebirdClient\FbConnectionInternal.cs, line 298) has incorrect condition: public void TransactionUpdated() { for (int i = 0; i < this.preparedCommands.Count; i++) { if (!this.preparedCommands[i].IsAlive) continue; FbCommand command = this.preparedCommands[i].Target as FbCommand; //<<<= may be a null if (command.Transaction != null) //<<<= potential NRE. Correct code is: command != null && command.Transaction != null { command.CloseReader(); command.Transaction = null; } } } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |