Skip to content

FIX: validate VariationSelectorSmuggler base character - #2562

Open
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
microsoft:mainfrom
sylvesterkaczmarek:fix/variation-selector-base-char-validation
Open

FIX: validate VariationSelectorSmuggler base character#2562
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 2 commits into
microsoft:mainfrom
sylvesterkaczmarek:fix/variation-selector-base-char-validation

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Description

VariationSelectorSmugglerConverter accepts any string for base_char_utf8, but the encoding format treats the value as a single Unicode base character and encode_message() calls ord() on it.

Empty or multi-character values therefore construct successfully and fail later during conversion with a TypeError.

This change validates base_char_utf8 during initialization and raises a clear ValueError unless it contains exactly one Unicode character.

Tests

Adds regression coverage for empty and multi-character base values and preserves valid single-character custom bases.

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