View Issue Details

IDProjectCategoryView StatusLast Update
0003966JEDI VCL00 JVCL Componentspublic2006-11-22 12:27
ReporterNazgulAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.20 
Target VersionFixed in Version 
Summary0003966: TJvXmlTree.ParseXML fails if Lines.Count = 0
DescriptionIf TJvXMLTree.ParseXML is called and Lines.Count is zero, an exception "List index out of bounds (0)" is raised.
Additional InformationI fixed this issue (changed the repeat...until cycle to while...do). Checked the attached patch.
TagsNo tags attached.

Activities

2006-10-21 09:06

 

JvXMLTree.pas.patch (576 bytes)
--- E:/bds4/Imports/jvcl/run/__history/JvXmlTree.pas.~1~	Thu Feb 17 11:21:20 2005
+++ E:/bds4/Imports/jvcl/run/JvXmlTree.pas	Sat Oct 21 16:30:24 2006
@@ -1336,7 +1336,9 @@
   Name := 'root';
   N := Self;
   C := Lines.Count - 1;
-  repeat
+//  repeat
+  while I <= C do
+  begin
     S := Lines[I];
     Token := Copy(S, 1, 3);
     AName := Copy(S, 4, Length(S));
@@ -1364,7 +1366,8 @@
       N.ValueType := xvtCDATA;
     end;
     Inc(I);
-  until I > C;
+  //until I > C;
+  end;
 end;
 
 procedure TJvXMLTree.LoadFromFile(const FileName: string);
JvXMLTree.pas.patch (576 bytes)

AHUser

2006-11-22 12:26

developer   ~0010442

Fixed in SVN.

Thanks for the patch.

Issue History

Date Modified Username Field Change
2006-10-21 09:06 Nazgul New Issue
2006-10-21 09:06 Nazgul File Added: JvXMLTree.pas.patch
2006-11-22 12:26 AHUser Status new => resolved
2006-11-22 12:26 AHUser Resolution open => fixed
2006-11-22 12:26 AHUser Assigned To => AHUser
2006-11-22 12:26 AHUser Note Added: 0010442