Skip to content

Fix DICOM UL AE title field length validation - #798

Merged
Enet4 merged 4 commits into
Enet4:masterfrom
atlex00:fix/ul-ae-title-wire-length
Aug 2, 2026
Merged

Fix DICOM UL AE title field length validation#798
Enet4 merged 4 commits into
Enet4:masterfrom
atlex00:fix/ul-ae-title-wire-length

Conversation

@atlex00

@atlex00 atlex00 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The A-ASSOCIATE writer encoded the Called/Calling AE titles and then called resize(16, b' '). Invalid values slipped through: empty and all-space titles were written as the forbidden all-spaces field, and titles longer than 16 bytes were silently truncated.

DICOM PS3.8 §9.3.2 defines both as fixed 16-byte fields where the all-spaces value is not allowed. This adds a shared writer helper that pads valid shorter titles to 16 bytes and returns WriteError::InvalidFixedSizeTextField for empty, all-space, or overlong titles, used for both A-ASSOCIATE-RQ and A-ASSOCIATE-AC.

@atlex00
atlex00 marked this pull request as ready for review June 22, 2026 22:36
@atlex00
atlex00 force-pushed the fix/ul-ae-title-wire-length branch from 14de7c1 to bafda0f Compare June 22, 2026 22:42
@atlex00
atlex00 marked this pull request as draft June 22, 2026 23:05
@atlex00
atlex00 marked this pull request as ready for review June 22, 2026 23:16
@atlex00
atlex00 force-pushed the fix/ul-ae-title-wire-length branch from 43e86f8 to c9b4e8b Compare June 23, 2026 00:45
@atlex00
atlex00 marked this pull request as draft June 23, 2026 00:56
@atlex00
atlex00 marked this pull request as ready for review June 23, 2026 13:28
@atlex00
atlex00 marked this pull request as draft June 29, 2026 11:11
@atlex00

This comment was marked as resolved.

@atlex00
atlex00 force-pushed the fix/ul-ae-title-wire-length branch from 5930f1e to 67e94c7 Compare June 29, 2026 11:18
@atlex00
atlex00 force-pushed the fix/ul-ae-title-wire-length branch from 67e94c7 to 75d9cdb Compare June 29, 2026 11:24
@atlex00
atlex00 marked this pull request as ready for review June 29, 2026 11:35
@Enet4 Enet4 added A-lib Area: library C-ul Crate: dicom-ul labels Jun 30, 2026

@Enet4 Enet4 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this. The writer really ought to ensure that the output stays compliant when faced with bad input such as an invalid AE title.

I have only a small suggestion to implement before we proceed.

Comment thread ul/src/pdu/writer.rs Outdated

@Enet4 Enet4 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No more concerns here from my side. Thank you!

@Enet4
Enet4 merged commit aa03475 into Enet4:master Aug 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library C-ul Crate: dicom-ul

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants