Skip to content

Commit

Permalink
[sonic_py_common] replace yaml.load to yaml.safe_load (#14991)
Browse files Browse the repository at this point in the history
Why I did it
replace yaml.load to yaml.safe_load because yaml.safe_load is more secure

Work item tracking
Microsoft ADO (number only): 15022050
How I did it
How to verify it
Verified in DUT 201911 which yaml version < 5.1
  • Loading branch information
maipbui authored May 10, 2023
1 parent efeae03 commit 73914e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sonic-py-common/sonic_py_common/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def get_sonic_version_info():
if yaml.__version__ >= "5.1":
sonic_ver_info = yaml.full_load(stream)
else:
sonic_ver_info = yaml.load(stream)
sonic_ver_info = yaml.safe_load(stream)

return sonic_ver_info

Expand Down

0 comments on commit 73914e7

Please sign in to comment.