aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/script/testdata
diff options
context:
space:
mode:
authorAbhinav Gupta <mail@abhinavg.net>2024-02-22 21:00:46 -0800
committerDavid Chase <drchase@google.com>2026-04-06 09:03:41 -0700
commit47d6423673479edc418e777d221f2527076e9944 (patch)
tree594ece722a8395558ce15acf8766912401947074 /src/cmd/internal/script/testdata
parent70dc75b79b7454caf0ed256b51ff716f880b317d (diff)
downloadgo-47d6423673479edc418e777d221f2527076e9944.tar.xz
cmd/go/internal/script: add fuzz test for quoteArgs
Adds a fuzz test for quoteArgs and fixes the bugs it found: handling of empty strings and strings containing "&" or "$". This is a copy of a similar change submitted to rsc.io/script: https://github.com/rsc/script/pull/10 Change-Id: I76e7fc89475e1c4e415f45f2c7ac4a87a7a659e6 Reviewed-on: https://go-review.googlesource.com/c/go/+/566316 Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Matloob <matloob@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/internal/script/testdata')
-rw-r--r--src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/2abacd54f8b6b0562
-rw-r--r--src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/5838cdfae7b16cde2
-rw-r--r--src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/e6019c3e89cc4df92
3 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/2abacd54f8b6b056 b/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/2abacd54f8b6b056
new file mode 100644
index 0000000000..8e2be246c5
--- /dev/null
+++ b/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/2abacd54f8b6b056
@@ -0,0 +1,2 @@
+go test fuzz v1
+string("0\xa2$000")
diff --git a/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/5838cdfae7b16cde b/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/5838cdfae7b16cde
new file mode 100644
index 0000000000..64c3abaff8
--- /dev/null
+++ b/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/5838cdfae7b16cde
@@ -0,0 +1,2 @@
+go test fuzz v1
+string("")
diff --git a/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/e6019c3e89cc4df9 b/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/e6019c3e89cc4df9
new file mode 100644
index 0000000000..67f8cfc58b
--- /dev/null
+++ b/src/cmd/internal/script/testdata/fuzz/FuzzQuoteArgs/e6019c3e89cc4df9
@@ -0,0 +1,2 @@
+go test fuzz v1
+string("&")