Download tasks/codeql_python_benchmark51_v2/pyvul-36a40541d7c74a9a7777/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.87 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-36a40541d7c74a9a7777/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_python_benchmark51_v2/pyvul-36a40541d7c74a9a7777/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-36a40541d7c74a9a7777/patch.diff
1.87 kB
| diff --git a/CHANGELOG.md b/CHANGELOG.md | |
| index 225fced44..7bfe08edb 100644 | |
| --- a/CHANGELOG.md | |
| +++ b/CHANGELOG.md | |
| The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). | |
| - Fixed an issue where `HorovodStrategy.teardown()` did not complete gracefully if an exception was thrown during callback setup [#11752](https://github.com/PyTorchLightning/pytorch-lightning/pull/11752) | |
| + | |
| - Fixed security vulnerabilities CVE-2020-1747 and CVE-2020-14343 caused by the `PyYAML` dependency ([#11099](https://github.com/PyTorchLightning/pytorch-lightning/pull/11099)) | |
| +- Fixed security vulnerability "CWE-94: Improper Control of Generation of Code (Code Injection)" ([#12212](https://github.com/PyTorchLightning/pytorch-lightning/pull/12212)) | |
| + | |
| + | |
| - Fixed logging on `{test,validation}_epoch_end` with multiple dataloaders ([#11132](https://github.com/PyTorchLightning/pytorch-lightning/pull/11132)) | |
| diff --git a/pytorch_lightning/utilities/argparse.py b/pytorch_lightning/utilities/argparse.py | |
| index e729f862c..8927ff093 100644 | |
| --- a/pytorch_lightning/utilities/argparse.py | |
| +++ b/pytorch_lightning/utilities/argparse.py | |
| import inspect | |
| import os | |
| from abc import ABC | |
| from argparse import _ArgumentGroup, ArgumentParser, Namespace | |
| +from ast import literal_eval | |
| from contextlib import suppress | |
| from functools import wraps | |
| from typing import Any, Callable, cast, Dict, List, Tuple, Type, TypeVar, Union | |
| def parse_env_variables(cls: Type["pl.Trainer"], template: str = "PL_%(cls_name) | |
| # todo: specify the possible exception | |
| with suppress(Exception): | |
| # converting to native types like int/float/bool | |
| - val = eval(val) | |
| + val = literal_eval(val) | |
| env_args[arg_name] = val | |
| return Namespace(**env_args) | |