aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2014-09-03 09:21:35 +0900
committermattn <mattn.jp@gmail.com>2014-09-03 09:21:35 +0900
commit3ab1d6f3481128cefecd12ab6cc9cfa61b11f2ce (patch)
tree6cefdfd48a57709a121c7e58a80819c791c2d66e /sqlite3.go
parentMerge branch 'pr/135' (diff)
parentMerge pull request #140 from pblaszczyk/patch-1 (diff)
downloadgolite-3ab1d6f3481128cefecd12ab6cc9cfa61b11f2ce.tar.gz
golite-3ab1d6f3481128cefecd12ab6cc9cfa61b11f2ce.tar.xz
Merge branch 'master' of https://github.com/mattn/go-sqlite3
Diffstat (limited to 'sqlite3.go')
-rw-r--r--sqlite3.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/sqlite3.go b/sqlite3.go
index 38eb942..8757a75 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -164,6 +164,9 @@ func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, err
var res driver.Result
if s.(*SQLiteStmt).s != nil {
na := s.NumInput()
+ if len(args) < na {
+ return nil, errors.New("args is not enough to execute query")
+ }
res, err = s.Exec(args[:na])
if err != nil && err != driver.ErrSkip {
s.Close()