Skip to content

Commit 3a21b7e

Browse files
hyperpolymathclaude
andcommitted
fix: replace String.to_atom with String.to_existing_atom
Prevents BEAM atom table exhaustion from unbounded String.to_atom calls. Detected by panic-attack assail batch scan (2026-03-30). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2234ac4 commit 3a21b7e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

opsm_ex/lib/opsm/federation.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,9 @@ defmodule Opsm.Federation do
431431
# Extract simple keyword pairs: key: value
432432
Regex.scan(~r/(\w+):\s*(?::(\w+)|"([^"]*)"|(~\w\[.*?\]))/m, block)
433433
|> Enum.map(fn
434-
[_, key, atom_val, "", ""] -> {String.to_atom(key), String.to_atom(atom_val)}
435-
[_, key, "", str_val, ""] -> {String.to_atom(key), str_val}
436-
[_, key, "", "", sigil] -> {String.to_atom(key), sigil}
434+
[_, key, atom_val, "", ""] -> {String.to_existing_atom(key), String.to_existing_atom(atom_val)}
435+
[_, key, "", str_val, ""] -> {String.to_existing_atom(key), str_val}
436+
[_, key, "", "", sigil] -> {String.to_existing_atom(key), sigil}
437437
_ -> nil
438438
end)
439439
|> Enum.reject(&is_nil/1)

0 commit comments

Comments
 (0)