You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by "plutext (via GitHub)" <gi...@apache.org> on 2026/10/04 22:24:30 UTC
[PR] FOP-3350: PDFPageLabels: a page label of "0" is written as a prefix label, not read past its end [xmlgraphics-fop]
plutext opened a new pull request, #122:
URL: https://github.com/apache/xmlgraphics-fop/pull/122
Fixes [FOP-3350](https://issues.apache.org/jira/browse/FOP-3350).
`PDFPageLabels.addPageLabel` counts a decimal label's leading zeros with
```java
do {
zeroPadding++;
} while (pageLabel.charAt(zeroPadding) == '0');
```
which runs past the end of a label made only of zeros (`StringIndexOutOfBoundsException`). A page numbered 0 is
reachable wherever a page sequence's numbering yields 0: an extension, or a user agent that honours
`initial-page-number="0"`, as documents converted from word processors ask for a cover page.
**The change.** An all-zero decimal label is written as a prefix label (`/P`), since `/St` must be at least 1
(ISO 32000-1, 12.4.2), and the loop is skipped for it.
**Test.** `PDFPageLabelsTestCase.testPageNumberedZero` labels "0", "1", "2" and expects
`[0 << /P (0) >> 1 << /S /D >>]`. Without the change it throws. With it, the fop-core suite passes, 3660 tests
and 0 failures, and checkstyle reports 0 violations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org
Re: [PR] FOP-3350: PDFPageLabels: a page label of "0" is written as a prefix label, not read past its end [xmlgraphics-fop]
Posted by "plutext (via GitHub)" <gi...@apache.org>.
plutext commented on PR #122:
URL: https://github.com/apache/xmlgraphics-fop/pull/122#issuecomment-6180365680
Closing: FOP-3350 was closed on 2026-10-08 with the reading that FOP itself never reaches this path, which is right; the hardening stays in docx4j-fo-renderer, which does.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org
Re: [PR] FOP-3350: PDFPageLabels: a page label of "0" is written as a prefix label, not read past its end [xmlgraphics-fop]
Posted by "plutext (via GitHub)" <gi...@apache.org>.
plutext closed pull request #122: FOP-3350: PDFPageLabels: a page label of "0" is written as a prefix label, not read past its end
URL: https://github.com/apache/xmlgraphics-fop/pull/122
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org