Skip to content

Commit

Permalink
avoid GPF in TMemoryMapText.LoadFromMap on void file
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed May 11, 2023
1 parent 5bfb497 commit 6af3d45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core/mormot.core.buffers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8870,6 +8870,8 @@ procedure TMemoryMapText.LoadFromMap(AverageLineLength: integer = 32);
var
P: PUtf8Char;
begin
if fMap.Buffer = nil then
exit;
fLinesMax := fMap.FileSize div AverageLineLength + 8;
GetMem(fLines, fLinesMax * SizeOf(pointer));
P := pointer(fMap.Buffer);
Expand Down
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'2.1.5438'
'2.1.5439'

0 comments on commit 6af3d45

Please sign in to comment.