Skip to content

Commit 3186bae

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
windows: remove the 8192-codepoint arg limit in FuzzComposeCommandLine
It just occurred to me that the observed limit was almost certainly a side effect of the Go wrapper for CommandLineToArgv (golang/go#63236) rather than a behavior of the system call itself. Updates golang/go#63236. Updates golang/go#58817. Change-Id: Icc9db01f201f54a78044d1c48e0883e098cfb5e5 Cq-Include-Trybots: luci.golang.try:x_sys-gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/sys/+/531176 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Quim Muntal <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
1 parent 807530f commit 3186bae

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

windows/syscall_windows_test.go

+1-10
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ func FuzzComposeCommandLine(f *testing.F) {
589589
f.Add(`C:\"Program Files"\Go\bin\go.exe` + "\x00env")
590590
f.Add(`C:\"Pro"gram Files\Go\bin\go.exe` + "\x00env")
591591
f.Add("\x00" + strings.Repeat("a", 8192))
592+
f.Add("\x00" + strings.Repeat("a", 8193))
592593
f.Add(strings.Repeat("\x00"+strings.Repeat("a", 8192), 4))
593594

594595
f.Fuzz(func(t *testing.T, s string) {
@@ -629,16 +630,6 @@ func FuzzComposeCommandLine(f *testing.F) {
629630
// have one or more runes converted to replacement characters.
630631
t.Skipf("skipping: input %d is not valid UTF-8", i)
631632
}
632-
if len(arg) > 8192 {
633-
// CommandLineToArgvW seems to truncate each argument after 8192
634-
// UTF-16 code units, although this behavior is not documented. Since
635-
// it isn't documented, we shouldn't rely on it one way or the other,
636-
// so skip the input to tell the fuzzer to try a different approach.
637-
enc, _ := windows.UTF16FromString(arg)
638-
if len(enc) > 8192 {
639-
t.Skipf("skipping: input %d encodes to more than 8192 UTF-16 code units", i)
640-
}
641-
}
642633
}
643634
if testing.Verbose() {
644635
t.Logf("using input: %#q", args)

0 commit comments

Comments
 (0)