diff --git a/sqlite.go b/sqlite.go index b95379c..778b42e 100644 --- a/sqlite.go +++ b/sqlite.go @@ -993,7 +993,9 @@ func (c *conn) bindBlob(pstmt uintptr, idx1 int, value []byte) (uintptr, error) return 0, err } - copy((*libc.RawMem)(unsafe.Pointer(p))[:len(value):len(value)], value) + if len(value) != 0 { + copy((*libc.RawMem)(unsafe.Pointer(p))[:len(value):len(value)], value) + } if rc := sqlite3.Xsqlite3_bind_blob(c.tls, pstmt, int32(idx1), p, int32(len(value)), 0); rc != sqlite3.SQLITE_OK { c.free(p) return 0, c.errstr(rc)