Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from Anon-Artist/RCE-fix
Browse files Browse the repository at this point in the history
Rce fix
  • Loading branch information
JamieSlome authored Jan 17, 2021
2 parents fbbe14d + a2d815d commit ea3beba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nni/tools/nnictl/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_yml_content(file_path):
'''Load yaml file content'''
try:
with open(file_path, 'r') as file:
return yaml.load(file, Loader=yaml.Loader)
return yaml.load(file, Loader=yaml.SafeLoader)
except yaml.scanner.ScannerError as err:
print_error('yaml file format error!')
print_error(err)
Expand Down
2 changes: 1 addition & 1 deletion nni/tools/package_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def read_registerd_algo_meta():
config_file = get_registered_algo_config_path()
if os.path.exists(config_file):
with open(config_file, 'r') as f:
config = yaml.load(f, Loader=yaml.Loader)
config = yaml.load(f, Loader=yaml.SafeLoader)
else:
config = defaultdict(list)
for t in ALGO_TYPES:
Expand Down

0 comments on commit ea3beba

Please sign in to comment.