Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: brendan-duncan/archive
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Telosnex/archive_endless_fix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Sep 7, 2024

  1. Verified

    This commit was signed with the committer’s verified signature.
    aik099 Alex
    Copy the full SHA
    7fc9632 View commit details
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/src/codecs/zip/zip_directory.dart
  2. +5 −0 test/zip_test.dart
2 changes: 1 addition & 1 deletion lib/src/codecs/zip/zip_directory.dart
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ class ZipDirectory {
var startPos = length - chunkSize;
int endPos() => startPos + chunkSize;

while (startPos >= 0) {
while (startPos >= 0 && startPos < length) {
for (var innerPos = startPos; innerPos < endPos(); innerPos++) {
input.setPosition(innerPos);
final sig = input.readUint32();
5 changes: 5 additions & 0 deletions test/zip_test.dart
Original file line number Diff line number Diff line change
@@ -218,6 +218,11 @@ void main() async {
expect(decoded.length, equals(0));
});

test('decode 0 bytes', () async {
final archive = ZipDecoder().decodeBytes(Uint8List(0));
expect(archive.length, equals(0));
});

test('apk', () async {
final archive = Archive()
..addFile(