Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Luke <jluke@mono-cvs.ximian.com>2003-12-05 06:57:56 +0300
committerJohn Luke <jluke@mono-cvs.ximian.com>2003-12-05 06:57:56 +0300
commit2b593229c252da7e1e945ca5088779a29cbe3e4f (patch)
tree0c47a1cf06c82abd97804486aa12986b204f0634 /mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs
parent920206633a75483d40dbd6ce31d92b16395194d4 (diff)
2003-12-04 John Luke <jluke@cfl.rr.com>
* SqlXmlTextReader.cs: applied patch from Chris Masters <neeeeeep@bigpond.com> fix peek so it checks if it is at the end and also to make sure that if Read() advances the position past the end of the localBuffer array, it makes a call to GetNextBuffer(). fixes bug #40253 System.IndexOutOfRangeException when using SqlCommand.ExecuteXmlReader() svn path=/trunk/mcs/; revision=20797
Diffstat (limited to 'mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs')
-rw-r--r--mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs
index 4bd8a6eeea3..908ab0b5058 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs
@@ -78,7 +78,6 @@ namespace System.Data.SqlClient {
else {
eof = true;
localBuffer = "</results>";
- return false;
}
return true;
}
@@ -91,6 +90,8 @@ namespace System.Data.SqlClient {
if (!moreResults)
return -1;
}
+ if (eof && position >= localBuffer.Length)
+ return -1;
return (int) localBuffer[position];
}
@@ -98,6 +99,8 @@ namespace System.Data.SqlClient {
{
int result = Peek ();
position += 1;
+ if (!eof && position >= localBuffer.Length)
+ GetNextBuffer ();
return result;
}