FIX: Bug [0001269] "Access violation when trying to open certain zip file"

This commit is contained in:
Alexander Koblov 2016-01-08 13:33:15 +00:00
commit ee49ea17c0

View file

@ -659,7 +659,7 @@ begin
// And not set directory attribute. So delete path
// delimiter if present and add directory attribute.
NameLength := Length(Header.FileName);
if (Header.FileName[NameLength] = PathDelim) then
if (NameLength > 0) and (Header.FileName[NameLength] = PathDelim) then
begin
Delete(Header.FileName, NameLength, 1);
Header.FileAttr := Header.FileAttr or faFolder;