Re: [Firebird-net-provider] [FB-Tracker] Created: (DNET-370) Bug in the RemoveComments function of FbScript class

2011-08-09 Thread charlie
Was wondering if anything has been done with this? 

Comments with procedure and trigger is very vital to our business practice. 



--
View this message in context: 
http://firebird.1100200.n4.nabble.com/FB-Tracker-Created-DNET-370-Bug-in-the-RemoveComments-function-of-FbScript-class-tp3355915p3730610.html
Sent from the firebird-net-provider mailing list archive at Nabble.com.

--
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


[Firebird-net-provider] [FB-Tracker] Created: (DNET-370) Bug in the RemoveComments function of FbScript class

2011-03-15 Thread Naveen Rajamohan (JIRA)
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