Skip to content

Commit

Permalink
(SIO-2222) Use yaml.safe_load instead of yaml.load
Browse files Browse the repository at this point in the history
This fixes following warning:
     YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

Using yaml.load on user input (uploaded packages) is unsefe.

Change-Id: I3e1c4dbaa7e4342ada4216e46956883aa0edd5a7
  • Loading branch information
cytadela8 committed Apr 4, 2019
1 parent 82f351a commit 9c89cff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oioioi/sinolpack/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ExtraConfig(models.Model):
def parsed_config(self):
if not self.config:
return {}
return yaml.load(self.config)
return yaml.safe_load(self.config)

class Meta(object):
verbose_name = _("sinolpack's configuration")
Expand Down

0 comments on commit 9c89cff

Please sign in to comment.