Bug in the RemoveComments function of FbScript class ----------------------------------------------------
Key: DNET-370 URL: http://tracker.firebirdsql.org/browse/DNET-370 Project: .NET Data provider Issue Type: Bug Components: ADO.NET Provider Affects Versions: 2.6 Environment: All version Reporter: Naveen Rajamohan Assignee: Jiri Cincura Execute the below query without the double quotes "select * from table_name --This is a comment line" The above query will result in an "IndexOutOfRange" exception. I debugged the source code and found that the problem is because, in the RemoveComments() function, there is code as follows else if ((source[i] == '-' && (i < length - 1) && source[i + 1] == '-')) { i++; while (source[i] != '\n')// exeception will occur at this line { i++; } i--; } the while codition is only checking for '\n', but in the above query since the comment is in the last line, it will never find another '\n', so the loop index will grow to a value greater than the length of string causing the above exception The while loop should actually be modified as follows while( i < length && source[i] != '\n' ) { i++; } -- 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 ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider