@@ -277,7 +277,7 @@ function getEndOfCentralDirectoryRecord(self, actuallyJustTellMeHowLongItWouldBe
277
277
}
278
278
}
279
279
280
- var eocdrBuffer = Buffer . alloc ( END_OF_CENTRAL_DIRECTORY_RECORD_SIZE ) ;
280
+ var eocdrBuffer = Buffer . allocUnsafe ( END_OF_CENTRAL_DIRECTORY_RECORD_SIZE ) ;
281
281
// end of central dir signature 4 bytes (0x06054b50)
282
282
eocdrBuffer . writeUInt32LE ( 0x06054b50 , 0 ) ;
283
283
// number of this disk 2 bytes
@@ -301,7 +301,7 @@ function getEndOfCentralDirectoryRecord(self, actuallyJustTellMeHowLongItWouldBe
301
301
302
302
// ZIP64 format
303
303
// ZIP64 End of Central Directory Record
304
- var zip64EocdrBuffer = Buffer . alloc ( ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE ) ;
304
+ var zip64EocdrBuffer = Buffer . allocUnsafe ( ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE ) ;
305
305
// zip64 end of central dir signature 4 bytes (0x06064b50)
306
306
zip64EocdrBuffer . writeUInt32LE ( 0x06064b50 , 0 ) ;
307
307
// size of zip64 end of central directory record 8 bytes
@@ -327,7 +327,7 @@ function getEndOfCentralDirectoryRecord(self, actuallyJustTellMeHowLongItWouldBe
327
327
328
328
329
329
// ZIP64 End of Central Directory Locator
330
- var zip64EocdlBuffer = Buffer . alloc ( ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE ) ;
330
+ var zip64EocdlBuffer = Buffer . allocUnsafe ( ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE ) ;
331
331
// zip64 end of central dir locator signature 4 bytes (0x07064b50)
332
332
zip64EocdlBuffer . writeUInt32LE ( 0x07064b50 , 0 ) ;
333
333
// number of the disk with the start of the zip64 end of central directory 4 bytes
@@ -437,7 +437,7 @@ Entry.prototype.getLocalFileHeader = function() {
437
437
uncompressedSize = this . uncompressedSize ;
438
438
}
439
439
440
- var fixedSizeStuff = Buffer . alloc ( LOCAL_FILE_HEADER_FIXED_SIZE ) ;
440
+ var fixedSizeStuff = Buffer . allocUnsafe ( LOCAL_FILE_HEADER_FIXED_SIZE ) ;
441
441
var generalPurposeBitFlag = FILE_NAME_IS_UTF8 ;
442
442
if ( ! this . crcAndFileSizeKnown ) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES ;
443
443
@@ -476,10 +476,10 @@ var ZIP64_DATA_DESCRIPTOR_SIZE = 24;
476
476
Entry . prototype . getDataDescriptor = function ( ) {
477
477
if ( this . crcAndFileSizeKnown ) {
478
478
// the Mac Archive Utility requires this not be present unless we set general purpose bit 3
479
- return Buffer . alloc ( 0 ) ;
479
+ return Buffer . allocUnsafe ( 0 ) ;
480
480
}
481
481
if ( ! this . useZip64Format ( ) ) {
482
- var buffer = Buffer . alloc ( DATA_DESCRIPTOR_SIZE ) ;
482
+ var buffer = Buffer . allocUnsafe ( DATA_DESCRIPTOR_SIZE ) ;
483
483
// optional signature (required according to Archive Utility)
484
484
buffer . writeUInt32LE ( 0x08074b50 , 0 ) ;
485
485
// crc-32 4 bytes
@@ -491,7 +491,7 @@ Entry.prototype.getDataDescriptor = function() {
491
491
return buffer ;
492
492
} else {
493
493
// ZIP64 format
494
- var buffer = Buffer . alloc ( ZIP64_DATA_DESCRIPTOR_SIZE ) ;
494
+ var buffer = Buffer . allocUnsafe ( ZIP64_DATA_DESCRIPTOR_SIZE ) ;
495
495
// optional signature (unknown if anyone cares about this)
496
496
buffer . writeUInt32LE ( 0x08074b50 , 0 ) ;
497
497
// crc-32 4 bytes
@@ -506,7 +506,7 @@ Entry.prototype.getDataDescriptor = function() {
506
506
var CENTRAL_DIRECTORY_RECORD_FIXED_SIZE = 46 ;
507
507
var ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE = 28 ;
508
508
Entry . prototype . getCentralDirectoryRecord = function ( ) {
509
- var fixedSizeStuff = Buffer . alloc ( CENTRAL_DIRECTORY_RECORD_FIXED_SIZE ) ;
509
+ var fixedSizeStuff = Buffer . allocUnsafe ( CENTRAL_DIRECTORY_RECORD_FIXED_SIZE ) ;
510
510
var generalPurposeBitFlag = FILE_NAME_IS_UTF8 ;
511
511
if ( ! this . crcAndFileSizeKnown ) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES ;
512
512
@@ -522,7 +522,7 @@ Entry.prototype.getCentralDirectoryRecord = function() {
522
522
versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_ZIP64 ;
523
523
524
524
// ZIP64 extended information extra field
525
- zeiefBuffer = Buffer . alloc ( ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE ) ;
525
+ zeiefBuffer = Buffer . allocUnsafe ( ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE ) ;
526
526
// 0x0001 2 bytes Tag for this "extra" block type
527
527
zeiefBuffer . writeUInt16LE ( 0x0001 , 0 ) ;
528
528
// Size 2 bytes Size of this "extra" block
@@ -537,7 +537,7 @@ Entry.prototype.getCentralDirectoryRecord = function() {
537
537
// (omit)
538
538
} else {
539
539
versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_UTF8 ;
540
- zeiefBuffer = Buffer . alloc ( 0 ) ;
540
+ zeiefBuffer = Buffer . allocUnsafe ( 0 ) ;
541
541
}
542
542
543
543
// central file header signature 4 bytes (0x02014b50)
0 commit comments