Skip to content

Commit

Permalink
Use safe_load function to load YAML
Browse files Browse the repository at this point in the history
In our use case, we are *not* reading arbitrary input that could be
malicious. Still, because we know that what we're reading is made up of
only dictionaries and lists and not arbitrary Python objects, we might
as well use the more restrictive `safe_load` function rather than the
`load` function.
  • Loading branch information
anishathalye committed Aug 4, 2015
1 parent dcc3a19 commit 4381c4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dotbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def __init__(self, config_file_path):
def _read(self, config_file_path):
try:
with open(config_file_path) as fin:
data = yaml.load(fin)
data = yaml.safe_load(fin)
return data
except Exception as e:
msg = string.indent_lines(str(e))
Expand Down

0 comments on commit 4381c4c

Please sign in to comment.