Browse Source

* fix for webbug 2870

pierre 21 years ago
parent
commit
2c782c1382
2 changed files with 6 additions and 2 deletions
  1. 3 1
      fv/stddlg.pas
  2. 3 1
      fvision/stddlg.pas

+ 3 - 1
fv/stddlg.pas

@@ -1156,8 +1156,10 @@ begin
     Path := PFileDialog(Owner)^.Directory^
   else Path := '';
   Path := FExpand(Path+PFileDialog(Owner)^.WildCard);
+  { avoid B Buffer overflow PM }
+  Path := ShrinkPath(Path, Size.X - 1);
   Color := GetColor($01);
-  MoveChar(B, ' ', Color, Size.X * Size.Y); { fill with empty spaces }
+  MoveChar(B, ' ', Color, Size.X); { fill with empty spaces }
   WriteLine(0, 0, Size.X, Size.Y, B);
   MoveStr(B[1], Path, Color);
   WriteLine(0, 0, Size.X, 1, B);

+ 3 - 1
fvision/stddlg.pas

@@ -1156,8 +1156,10 @@ begin
     Path := PFileDialog(Owner)^.Directory^
   else Path := '';
   Path := FExpand(Path+PFileDialog(Owner)^.WildCard);
+  { avoid B Buffer overflow PM }
+  Path := ShrinkPath(Path, Size.X - 1);
   Color := GetColor($01);
-  MoveChar(B, ' ', Color, Size.X * Size.Y); { fill with empty spaces }
+  MoveChar(B, ' ', Color, Size.X); { fill with empty spaces }
   WriteLine(0, 0, Size.X, Size.Y, B);
   MoveStr(B[1], Path, Color);
   WriteLine(0, 0, Size.X, 1, B);