mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 21:51:40 +03:00
Fix Issue 18452 - std.zip has size limit of 2 GB
This commit is contained in:
parent
6797b52c0d
commit
0dc7ea22b0
1 changed files with 7 additions and 7 deletions
14
std/zip.d
14
std/zip.d
|
@ -764,7 +764,7 @@ final class ZipArchive
|
|||
if (de.flags & 1)
|
||||
throw new ZipException("encryption not supported");
|
||||
|
||||
int i;
|
||||
uint i;
|
||||
i = de.offset + 30 + namelen + extralen;
|
||||
if (i + de.compressedSize > endrecOffset)
|
||||
throw new ZipException("invalid directory entry 5");
|
||||
|
@ -793,35 +793,35 @@ final class ZipArchive
|
|||
|
||||
/* ============ Utility =================== */
|
||||
|
||||
@safe @nogc pure nothrow ushort getUshort(int i)
|
||||
@safe @nogc pure nothrow ushort getUshort(uint i)
|
||||
{
|
||||
ubyte[2] result = data[i .. i + 2];
|
||||
return littleEndianToNative!ushort(result);
|
||||
}
|
||||
|
||||
@safe @nogc pure nothrow uint getUint(int i)
|
||||
@safe @nogc pure nothrow uint getUint(uint i)
|
||||
{
|
||||
ubyte[4] result = data[i .. i + 4];
|
||||
return littleEndianToNative!uint(result);
|
||||
}
|
||||
|
||||
@safe @nogc pure nothrow ulong getUlong(int i)
|
||||
@safe @nogc pure nothrow ulong getUlong(uint i)
|
||||
{
|
||||
ubyte[8] result = data[i .. i + 8];
|
||||
return littleEndianToNative!ulong(result);
|
||||
}
|
||||
|
||||
@safe @nogc pure nothrow void putUshort(int i, ushort us)
|
||||
@safe @nogc pure nothrow void putUshort(uint i, ushort us)
|
||||
{
|
||||
data[i .. i + 2] = nativeToLittleEndian(us);
|
||||
}
|
||||
|
||||
@safe @nogc pure nothrow void putUint(int i, uint ui)
|
||||
@safe @nogc pure nothrow void putUint(uint i, uint ui)
|
||||
{
|
||||
data[i .. i + 4] = nativeToLittleEndian(ui);
|
||||
}
|
||||
|
||||
@safe @nogc pure nothrow void putUlong(int i, ulong ul)
|
||||
@safe @nogc pure nothrow void putUlong(uint i, ulong ul)
|
||||
{
|
||||
data[i .. i + 8] = nativeToLittleEndian(ul);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue