From df7711fd23f7f8715865067955eadf9d883bd0e7 Mon Sep 17 00:00:00 2001 From: Giovanni Mazzeo Date: Thu, 16 Dec 2021 17:16:02 -0800 Subject: [PATCH] Use a safer LibYAML loader when parsing .yaml configuration for the CLI arguments. PiperOrigin-RevId: 416926145 --- capirca/utils/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capirca/utils/config.py b/capirca/utils/config.py index 17a392f2..acfd92c4 100644 --- a/capirca/utils/config.py +++ b/capirca/utils/config.py @@ -21,9 +21,9 @@ def yaml_loader(filename): with open(filename, 'r') as f: try: - data = yaml.load(f, Loader=yaml.CLoader) + data = yaml.safe_load(f) except AttributeError: - data = yaml.load(f, Loader=yaml.Loader) + data = yaml.safe_load(f) return data