openwrt/package/system/apk/patches
Matt Merhar 324e157b4b apk: handle edge case when parsing .apk files
This was a regression introduced in the recent alignment changes and led
to failures when reading (i.e. 'mkndx') certain packages like follows:

ERROR: python3-botocore-1.31.7-r1.apk: unexpected end of file

It affected packages with a header size greater than the read buffer
size of 128KB but less than 160KB (128KB + (128KB / 4)).

In those cases, we'd attempt a 0 byte read, leading to APKE_EOF.

Based on some tests of files across multiple archs and feeds, it seems
the only packages meeting those criteria were python3-botocore and
golang-github-jedisct1-dnscrypt-proxy2-dev.

Fixes: 64ec08eee1 ("apk: backport upstream fixes for unaligned access")
Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/21992
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 8c6ed4e927)
Link: https://github.com/openwrt/openwrt/pull/22001
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-13 00:12:35 +01:00
..
0001-openwrt-move-layer-db-to-temp-folder.patch apk: backport upstream fix for invalid fetch timestamps 2026-02-05 17:12:56 +01:00
0010-app_list-add-full-print.patch apk-tools: fix compilation warning from downstream full print patch 2025-10-14 17:15:07 +02:00
0020-io-fix-invalid-fetch-timestamps-with-wget-backend.patch apk: backport upstream fix for invalid fetch timestamps 2026-02-05 17:12:56 +01:00
0030-defines-align-apk_array.patch apk: backport upstream fixes for unaligned access 2026-02-10 15:07:44 +01:00
0031-defines-rework-apk_unaligned_-helpers.patch apk: backport upstream fixes for unaligned access 2026-02-10 15:07:44 +01:00
0032-extract_v3-fix-unaligned-access-of-file-mode.patch apk: backport upstream fixes for unaligned access 2026-02-10 15:07:44 +01:00
0033-io-synchronize-istream-buffer-alignment-with-file-of.patch apk: backport upstream fixes for unaligned access 2026-02-10 15:07:44 +01:00
0034-io-handle-edge-case-when-refilling-read-buffer.patch apk: handle edge case when parsing .apk files 2026-02-13 00:12:35 +01:00