Skip to content

Commit 7252ba2

Browse files
author
HD Moore
committed
Tweak memory usage from 64Mb to 4Mb
1 parent 3aa68c3 commit 7252ba2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rex/parser/fs/ntfs.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ def cluster_from_attribute_non_resident(attribute, cluster_num = 0, size_max = (
181181

182182
data = ''
183183
while data.length < size_wanted
184-
# use an arbitrary block size to avoid target memory consumption
185-
data << @file_handler.read([size_wanted - data.length, 2**26].min)
184+
# Use a 4Mb block size to avoid target memory consumption
185+
data << @file_handler.read([size_wanted - data.length, 2**22].min)
186186
end
187187
attribut << data
188188
end

0 commit comments

Comments
 (0)