1 Star 0 Fork 1

suzd/go-sqlite3-sqlcipher

forked from suzd/go-sqlite3-sqlcipher 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fuzz_openexec.go 489 Bytes
一键复制 编辑 原始数据 按行查看 历史
suzd 提交于 2025-02-22 15:45 +08:00 . gitee.com/suzd2025/go-sqlite3-sqlcipher
package sqlite3_fuzz
import (
"bytes"
"database/sql"
"io/ioutil"
_ "gitee.com/suzd2025/go-sqlite3-sqlcipher"
)
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
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/suzd2025/go-sqlite3-sqlcipher.git
git@gitee.com:suzd2025/go-sqlite3-sqlcipher.git
suzd2025
go-sqlite3-sqlcipher
go-sqlite3-sqlcipher
v1.0.9

搜索帮助