File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 6
6
Mix .install ([
7
7
{:grading_client , path: " #{ __DIR__ } /grading_client" },
8
8
:benchwarmer ,
9
+ :uuid ,
9
10
:kino ,
10
11
:plug
11
12
])
@@ -53,20 +54,18 @@ Beware of functions in applications/libraries that create atoms from input value
53
54
_ You should get a ` true ` result when you successfully fix the function._
54
55
55
56
``` elixir
56
- random_number = :rand .uniform (10000 )
57
- malicious_user_input = Integer .to_string (random_number)
58
- prev_count = :erlang .system_info (:atom_count )
57
+ malicious_user_input = UUID .uuid4 ()
59
58
60
59
try do
61
60
malicious_user_input
62
61
# ONLY CHANGE LINE 8
63
62
|> String .to_atom ()
64
63
rescue
65
- e -> {ArgumentError , e}
64
+ _ ->
65
+ IO .puts (" Are you protected against Atom Exhaustion?" )
66
+ IO .puts (" true" )
67
+ nil
66
68
end
67
-
68
- IO .puts (" Are you protected against Atom Exhaustion?" )
69
- IO .puts (:erlang .system_info (:atom_count ) == prev_count)
70
69
```
71
70
72
71
## Serialization and Deserialization
You can’t perform that action at this time.
0 commit comments