MCPcopy Create free account
hub / github.com/mattn/go-sqlite3 / FuzzOpenExec

Function FuzzOpenExec

_example/fuzz/fuzz_openexec.go:11–30  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

9)
10
11func FuzzOpenExec(data []byte) int {
12 sep := bytes.IndexByte(data, 0)
13 if sep <= 0 {
14 return 0
15 }
16 err := ioutil.WriteFile("/tmp/fuzz.db", data[sep+1:], 0644)
17 if err != nil {
18 return 0
19 }
20 db, err := sql.Open("sqlite3", "/tmp/fuzz.db")
21 if err != nil {
22 return 0
23 }
24 defer db.Close()
25 _, err = db.Exec(string(data[:sep]))
26 if err != nil {
27 return 0
28 }
29 return 1
30}

Callers

nothing calls this directly

Calls 3

OpenMethod · 0.65
CloseMethod · 0.65
ExecMethod · 0.45

Tested by

no test coverage detected