You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
StringSet accepts a NUL character, which PostgreSQL text cannot hold #133
StringSet (and StringSet<T>) accepts a NUL character in an element. PostgreSQL's text can't hold one, so the set parses and then fails when it reaches the database. Measured on main (3ecfa10) against PostgreSQL 17.10:
StringSet.Parse("{a\u0000b}",null).Count;// 1StringSet.From(["a\0b"]);// also accepted
SELECT chr(0); -- ERROR: null character not permitted-- a text[] parameter holding U+0000: invalid byte sequence for encoding "UTF8": 0x00
Found by LiteralCorpusProbeTests (#123), family NUL. Not a wrong value: the failure is loud, at save time, and away from where the text came in — the same class as #78 (text the server rejects parses in memory).
Authority.docs/serialization.md: the text is "the same text the server itself reads"; docs/value-sets.md maps StringSet to text[].
Fix (10.0.0). Refuse U+0000 in a string element on every construction path (Parse, TryParse, JSON, From), with a message naming the rule. Refusing input that parses today is breaking, so it goes in the major.
Fixed in #163 (stacked on #162): TextElement holds the rule once, and StringSet and StringSet<T> apply it on every construction path — From (both overloads) and Add/Contains/Remove throw ArgumentException, Parse, the TypeConverter and the EF JSON document throw FormatException, TryParse returns false, JSON throws JsonException — with a message naming NUL. Every other character stays text. LiteralCorpusProbeTests holds the two NUL rows without candidates. Proven by reverting the fix.
Activity
CaffeinatedCoder commentedon Oct 18, 2026
Fixed in #163 (stacked on #162):
TextElementholds the rule once, andStringSetandStringSet<T>apply it on every construction path —From(both overloads) andAdd/Contains/RemovethrowArgumentException,Parse, theTypeConverterand the EF JSON document throwFormatException,TryParsereturnsfalse, JSON throwsJsonException— with a message naming NUL. Every other character stays text.LiteralCorpusProbeTestsholds the two NUL rows without candidates. Proven by reverting the fix.