Skip to content

Reject prohibited NUL and ETX characters in sheet names - #1433

Merged
pjfanning merged 1 commit into
apache:trunkfrom
AryanRG:fix/reject-prohibited-sheet-name-controls
Oct 17, 2026
Merged

pjfanning merged 1 commit into
apache:trunkfrom
AryanRG:fix/reject-prohibited-sheet-name-controls

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Closes #1432.

WorkbookUtil.validateSheetName already documents U+0000 and U+0003 as invalid but did not reject them. Add those two cases to the existing switch and cover both with a regression test. The patch is limited to the validator and its test.

Validation: ./gradlew :poi:test --tests org.apache.poi.ss.util.TestWorkbookUtil --rerun-tasks --console=plain --no-daemon passed (2 tests) on the current trunk base. Direct HSSF/XSSF create/rename probes passed on the earlier base. A broader :poi:test :poi-ooxml:test run had four failures that reproduced on pristine base in this environment, so the full suite is not claimed green.

AI Assistance used.

@pjfanning
pjfanning merged commit a1e954f into apache:trunk Oct 17, 2026
4 checks passed
@pjfanning

Copy link
Copy Markdown
Member

Merged - thanks

pjfanning added a commit that referenced this pull request Oct 17, 2026
Follow-up to #1433. The error for an invalid sheet-name char embedded the
char itself, which for 0x0000 and 0x0003 is invisible in logs. Show
control chars as a code point, and assert the full messages in the tests.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WorkbookUtil.validateSheetName accepts prohibited NUL and ETX characters

2 participants