Skip to content

Fix ASN.1 ObjectId conversion at buffer boundary - #1138

Merged
rhenium merged 1 commit into
ruby:masterfrom
pgorgita:fix/issue-1137-asn1-object-id-length
Nov 6, 2026
Merged

rhenium merged 1 commit into
ruby:masterfrom
pgorgita:fix/issue-1137-asn1-object-id-length

Conversation

@pgorgita

@pgorgita pgorgita commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #1137.

OBJ_obj2txt returns the required string length without the NUL terminator. When that length equals the initial buffer capacity, the helper must retry with room for the terminator.

Add regression coverage for a 127-character numeric OID and verify both decoded value and oid match the original.

@rhenium rhenium left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice catch, thanks!

Retry OBJ_obj2txt when the required length equals the buffer capacity.
@rhenium
rhenium force-pushed the fix/issue-1137-asn1-object-id-length branch from 4c6bb07 to 6b9cb7b Compare November 6, 2026 18:52
@rhenium

rhenium commented Nov 6, 2026

Copy link
Copy Markdown
Member

I've squashed the changes into one commit.

@rhenium
rhenium merged commit 818fffd into ruby:master Nov 6, 2026
48 checks passed
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.

ASN.1 ObjectId conversion truncates exactly 127-character numeric OIDs

2 participants