Skip to content

fix(provisioning): size RegisterThing publish topic buffer to 150 - #137

Merged
MathiasKoch merged 1 commit into
masterfrom
fix/register-thing-publish-topic-overflow
Jul 13, 2026
Merged

MathiasKoch merged 1 commit into
masterfrom
fix/register-thing-publish-topic-overflow

Conversation

@MathiasKoch

Copy link
Copy Markdown
Member

Summary

The RegisterThing publish topic is formatted into a 69-byte buffer (provisioning/mod.rs:241, format::<69>()), while its sibling accepted/rejected topics use format::<150>().

The publish topic $aws/provisioning-templates/{template}/provision/{fmt} is 71 bytes for a 28-char template name:

segment len
$aws/provisioning-templates 27
/ 1
fleetDuoProvisioningTemplate 28
/provision/ 11
cbor 4
total 71

71 > 69, so Topic::format overflows and RegisterThing fails with Error::Overflow after the accepted/rejected subscribe and before the publish. Any provisioning template name longer than 26 characters hits this.

The publish topic is always shorter than its accepted/rejected variants (no /accepted or /rejected suffix), so sizing it at 150 matches them and is safely sufficient.

The RegisterThing publish topic was formatted into a 69-byte buffer while
the sibling accepted/rejected topics use 150. The publish topic
$aws/provisioning-templates/{template}/provision/{fmt} is 71 bytes for a
28-char template name (e.g. fleetDuoProvisioningTemplate), overflowing the
69-byte buffer and failing RegisterThing with Error::Overflow after the
subscribe and before the publish.

The publish topic is always shorter than its accepted/rejected variants (no
/accepted or /rejected suffix), so 150 matches them and is safely sufficient.
@MathiasKoch
MathiasKoch merged commit b7c63d4 into master Jul 13, 2026
5 checks passed
@MathiasKoch
MathiasKoch deleted the fix/register-thing-publish-topic-overflow branch July 13, 2026 10:17
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.

1 participant