Skip to content

OPDS: fix off-by-one in sync sub_table access#15073

Merged
Frenzie merged 1 commit into
koreader:masterfrom
msk:fix/opds-sync-off-by-one
Mar 5, 2026
Merged

OPDS: fix off-by-one in sync sub_table access#15073
Frenzie merged 1 commit into
koreader:masterfrom
msk:fix/opds-sync-off-by-one

Conversation

@msk

@msk msk commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

This PR fixes crash during OPDS sync download when a catalog entry's URL resolves to a sub_table with exactly one element. In that case, sub_table[2] returns nil, causing "attempt to index a nil value" on item.acquisitions.


This change is Reviewable

When an OPDS catalog entry's URL resolves to a sub_table with only one
element, sub_table[2] returns nil, causing a crash on the subsequent
item.acquisitions access. Fall back to sub_table[1] when index 2 is nil.
@Frenzie Frenzie merged commit 0c6d217 into koreader:master Mar 5, 2026
4 checks passed
@Frenzie Frenzie added the Plugin label Mar 5, 2026
@Frenzie Frenzie added this to the 2026.02 milestone Mar 5, 2026
@msk msk deleted the fix/opds-sync-off-by-one branch March 5, 2026 13:35
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
When an OPDS catalog entry's URL resolves to a sub_table with only one
element, sub_table[2] returns nil, causing a crash on the subsequent
item.acquisitions access. Fall back to sub_table[1] when index 2 is nil.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants