fix: update drifted citation line numbers
- option_parser.ex: String.to_existing_atom/1 is at line 859, not 855 (line 855 is the String.to_atom clause for allow_nonexistent_atoms) - logger test_helper.exs: capture_log after clause spans lines 57-65, not 57-62 (the 'after' keyword is at line 64, restore at line 65)
This commit is contained in:
@@ -880,7 +880,7 @@ end
|
|||||||
|
|
||||||
**What they avoid:** Converting untrusted strings to atoms.
|
**What they avoid:** Converting untrusted strings to atoms.
|
||||||
|
|
||||||
**Source evidence:** `lib/elixir/lib/option_parser.ex:855` — Uses `String.to_existing_atom/1` with the `:switches` allowlist pattern. The only `String.to_atom/1` calls in library code are in compiler/macro contexts where the set is bounded.
|
**Source evidence:** `lib/elixir/lib/option_parser.ex:859` — Uses `String.to_existing_atom/1` with the `:switches` allowlist pattern. The only `String.to_atom/1` calls in library code are in compiler/macro contexts where the set is bounded.
|
||||||
|
|
||||||
**Why it's bad:** Atoms are never garbage collected. User-controlled atom creation is a denial-of-service vector (1,048,576 atom limit by default).
|
**Why it's bad:** Atoms are never garbage collected. User-controlled atom creation is a denial-of-service vector (1,048,576 atom limit by default).
|
||||||
|
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ setup do
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
**Source:** `lib/logger/test/logger_test.exs:12-17` — Every Logger config change has a corresponding `on_exit` restoration. `lib/logger/test/test_helper.exs:57-62` — `capture_log` uses `after` to always restore level.
|
**Source:** `lib/logger/test/logger_test.exs:12-17` — Every Logger config change has a corresponding `on_exit` restoration. `lib/logger/test/test_helper.exs:57-65` — `capture_log` uses `after` to always restore level.
|
||||||
|
|
||||||
### When to Apply This Rule
|
### When to Apply This Rule
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user