[libc-commits] [libc] [libc] Use `yaml.safe_load` rather than `yaml.load` (PR #109557)
Petr Hosek via libc-commits
libc-commits at lists.llvm.org
Sat Sep 21 19:16:27 PDT 2024
https://github.com/petrhosek created https://github.com/llvm/llvm-project/pull/109557
`yaml.load` is considered unsafe, use `yaml.safe_load`.
>From f238e3b56c568b5fd9f16160558f85aacb4e7e7e Mon Sep 17 00:00:00 2001
From: Petr Hosek <phosek at google.com>
Date: Sat, 21 Sep 2024 19:14:09 -0700
Subject: [PATCH] [libc] Use `yaml.safe_load` rather than `yaml.load`
`yaml.load` is considered unsafe, use `yaml.safe_load`.
---
libc/newhdrgen/yaml_functions_sorted.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/newhdrgen/yaml_functions_sorted.py b/libc/newhdrgen/yaml_functions_sorted.py
index db19edf7481de2..b960ecaf973f52 100644
--- a/libc/newhdrgen/yaml_functions_sorted.py
+++ b/libc/newhdrgen/yaml_functions_sorted.py
@@ -6,7 +6,7 @@
def sort_yaml_functions(yaml_file):
with open(yaml_file, "r") as f:
- yaml_data = yaml.load(f, Loader=yaml.FullLoader)
+ yaml_data = yaml.safe_load(f)
if "functions" in yaml_data:
yaml_data["functions"].sort(key=lambda x: x["name"])
More information about the libc-commits
mailing list