File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -633,7 +633,11 @@ Buffer.concat = function concat(list, length) {
633633 pos += buf . length ;
634634 }
635635
636+ // Note: `length` is always equal to `buffer.length` at this point
636637 if ( pos < length ) {
638+ // Zero-fill the remaining bytes if the specified `length` was more than
639+ // the actual total length, i.e. if we have some remaining allocated bytes
640+ // there were not initialized.
637641 TypedArrayPrototypeFill ( buffer , 0 , pos , length ) ;
638642 }
639643 return buffer ;
@@ -661,7 +665,11 @@ Buffer.concat = function concat(list, length) {
661665 pos += buf . length ;
662666 }
663667
668+ // Note: `length` is always equal to `buffer.length` at this point
664669 if ( pos < length ) {
670+ // Zero-fill the remaining bytes if the specified `length` was more than
671+ // the actual total length, i.e. if we have some remaining allocated bytes
672+ // there were not initialized.
665673 TypedArrayPrototypeFill ( buffer , 0 , pos , length ) ;
666674 }
667675
You can’t perform that action at this time.
0 commit comments