diff options
author | EuAndreh <eu@euandre.org> | 2024-10-01 15:50:33 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-10-01 15:50:33 -0300 |
commit | bf67f44cfbc551b644542e25b953566ee383d5bd (patch) | |
tree | ac36f31e50850bf1a11b79fc344b4d685fff469c /doc/examples/fuzz/fuzz_openexec.go | |
parent | tests/golite.go: Enable slow tests (diff) | |
download | golite-bf67f44cfbc551b644542e25b953566ee383d5bd.tar.gz golite-bf67f44cfbc551b644542e25b953566ee383d5bd.tar.xz |
Turn example files into tests under tests/functional/
Diffstat (limited to 'doc/examples/fuzz/fuzz_openexec.go')
-rw-r--r-- | doc/examples/fuzz/fuzz_openexec.go | 30 |
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 -} |