Skip to content

Commit 491e134

Browse files
committed
Fix Improper Import Order Breaking fuzz_submodule Fuzzer
ClusterFuzz runs of the `fuzz_submodule` target have been failing because the `git` import was placed before the condition that sets the Git executable path. The order in which `git` is imported matters because it attempts to find a Git executable as the import is loaded (via `refresh()` in `git/__init__.py`.) As per #1909, we configure the ClusterFuzz environment to use a bundled Git executable via the env variable condition in all fuzz targets.
1 parent e51bfdf commit 491e134

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fuzzing/fuzz-targets/fuzz_submodule.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
import tempfile
55
from configparser import ParsingError
66
from utils import is_expected_exception_message, get_max_filename_length
7-
from git import Repo, GitCommandError, InvalidGitRepositoryError
87

98
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): # pragma: no cover
109
path_to_bundled_git_binary = os.path.abspath(os.path.join(os.path.dirname(__file__), "git"))
1110
os.environ["GIT_PYTHON_GIT_EXECUTABLE"] = path_to_bundled_git_binary
1211

12+
from git import Repo, GitCommandError, InvalidGitRepositoryError
13+
1314
if not sys.warnoptions: # pragma: no cover
1415
# The warnings filter below can be overridden by passing the -W option
1516
# to the Python interpreter command line or setting the `PYTHONWARNINGS` environment variable.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy