EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElZip64EndOfCentralDirectoryLocator memory leak in 10.0.233.0

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#25416
Posted: 06/24/2013 18:08:13
by Darian Miller (Standard support level)
Joined: 06/27/2011
Posts: 48

In Delphi XE2 Update 4, using SBB version 10.0.233.0

When creating a standard win32 or win64 application, unzipping a password-protected file using TElZipReader yields two memory leaks on application shutdown. Unzipping a non-password protect file does not yield a memory leak.

Create a basic VCL application and drop two buttons on a form...
Form1:

uses
SBArcZip, SBUtils;

FormCreate;
ReportMemoryLeaksOnShutdown := True;

FormDestroy;
SBUtils.CleanupRegisteredGlobalObjects;

Button1Click;
var
vZipReader:TElZipReader;
begin
vZipReader := TElZipReader.Create(nil);
try
vZipReader.Password := ZIP_PW;
vZipReader.Open(SOURCE_FILENAME1, True);
vZipReader.Extract('*.*', 'C:\Temp');
finally
vZipReader.Free();
end;
end;

Button2Click;
var
vZipReader:TElZipReader;
begin
vZipReader := TElZipReader.Create(nil);
try
vZipReader.Open(SOURCE_FILENAME2, True);
vZipReader.Extract('*.*', 'C:\Temp');
finally
vZipReader.Free();
end;
end;

If you run this, and unzip the password protected file, you should get unexpected memory leaks reported, with the number of leaks equal to the number of times clicking the button to unzip the file.

25-40 bytes: Unknown x 1
121-136 bytes: TElZip64EndOfCentralDirectoryLocator x 1


If you run this example and only unzip a non-password protected file, you should get no reported memory leaks.


The sample file being unzipped was created with TElZipWriter using options:

CompressionLevel := 6;
DirectoryCompressed := True;
CompressionAlgorithm := ZIP_COMPRESSION_DEFLATE;
Encrypt := True;
StrongEncryptionInfo.EncryptionAlgorithm := ZIP_ENCRYPTION_AES256;
DirectoryEncrypted := True;
StrongEncryption := True;
WinZipEncryption := False;
Password := ZIP_PW;

...
.CreateArchive();
.Add(file)
.Compress(dest)
#25417
Posted: 06/25/2013 00:41:20
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

I've moved your question to Helpdesk for investigation.

Reply

Statistics

Topic viewed 427 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!