aboutsummaryrefslogtreecommitdiff
path: root/doc/examples/fuzz
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-10-01 15:50:33 -0300
committerEuAndreh <eu@euandre.org>2024-10-01 15:50:33 -0300
commitbf67f44cfbc551b644542e25b953566ee383d5bd (patch)
treeac36f31e50850bf1a11b79fc344b4d685fff469c /doc/examples/fuzz
parenttests/golite.go: Enable slow tests (diff)
downloadgolite-bf67f44cfbc551b644542e25b953566ee383d5bd.tar.gz
golite-bf67f44cfbc551b644542e25b953566ee383d5bd.tar.xz
Turn example files into tests under tests/functional/
Diffstat (limited to 'doc/examples/fuzz')
-rw-r--r--doc/examples/fuzz/fuzz_openexec.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/doc/examples/fuzz/fuzz_openexec.go b/doc/examples/fuzz/fuzz_openexec.go
deleted file mode 100644
index 5326044..0000000
--- a/doc/examples/fuzz/fuzz_openexec.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package sqlite3_fuzz
-
-import (
- "bytes"
- "database/sql"
- "io/ioutil"
-
- _ "github.com/mattn/go-sqlite3"
-)
-
-func FuzzOpenExec(data []byte) int {
- sep := bytes.IndexByte(data, 0)
- if sep <= 0 {
- return 0
- }
- err := ioutil.WriteFile("/tmp/fuzz.db", data[sep+1:], 0644)
- if err != nil {
- return 0
- }
- db, err := sql.Open("sqlite3", "/tmp/fuzz.db")
- if err != nil {
- return 0
- }
- defer db.Close()
- _, err = db.Exec(string(data[:sep-1]))
- if err != nil {
- return 0
- }
- return 1
-}