do not allow strings containing null characters to be inlined (#2848)

This commit is contained in:
Mark Thom
2025-04-09 23:03:28 -07:00
committed by Mark Thom
parent 22080f3787
commit 98dae9aecc
4 changed files with 4 additions and 5 deletions

View File

@@ -467,7 +467,7 @@ impl AtomTable {
}
pub fn build_with(atom_table: &AtomTable, string: &str) -> Atom {
if 0 < string.len() && string.len() <= INLINED_ATOM_MAX_LEN {
if 0 < string.len() && string.len() <= INLINED_ATOM_MAX_LEN && !string.contains('\u{0}') {
return Atom::new_inlined(string);
}