Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf0cd93

Browse files
committed
Fix "OSError: [Errno 36] File name too long" in fuzz_submodule
Fixes a bug in the `fuzz_submodule` harness where the fuzzed data canproduce file names that exceed the maximum size allowed byt the OS. Thisissue came up previously and was fixed in#1922, but the submodule filename fixed here was missed in that PR.Fixes:https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69456
1 parent855befa commitaf0cd93

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎fuzzing/fuzz-targets/fuzz_submodule.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ def TestOneInput(data):
3535
sub_repo=Repo.init(submodule_temp_dir,bare=fdp.ConsumeBool())
3636
sub_repo.index.commit(fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1,512)))
3737

38-
submodule_name=f"submodule_{fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1,512))}"
38+
submodule_name=fdp.ConsumeUnicodeNoSurrogates(
39+
fdp.ConsumeIntInRange(1,max(1,get_max_filename_length(repo.working_tree_dir)))
40+
)
3941
submodule_path=os.path.join(repo.working_tree_dir,submodule_name)
40-
submodule_url=sub_repo.git_dir
4142

42-
submodule=repo.create_submodule(submodule_name,submodule_path,url=submodule_url)
43-
repo.index.commit(f"Added submodule{submodule_name}")
43+
submodule=repo.create_submodule(submodule_name,submodule_path,url=sub_repo.git_dir)
44+
repo.index.commit("Added submodule")
4445

4546
withsubmodule.config_writer()aswriter:
4647
key_length=fdp.ConsumeIntInRange(1,max(1,fdp.remaining_bytes()))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp