aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2014-08-18 18:23:58 +0900
committermattn <mattn.jp@gmail.com>2014-08-18 18:23:58 +0900
commitd069822191ca6ec71a5a678552a937e27173b393 (patch)
tree20a78586dfdcebf2ec4542bc1fc8b1a4721fa781 /sqlite3.go
parentAdd TestStress (diff)
downloadgolite-d069822191ca6ec71a5a678552a937e27173b393.tar.gz
golite-d069822191ca6ec71a5a678552a937e27173b393.tar.xz
Check parameter count
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 fc3e8ad..baa7fa3 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -159,6 +159,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 na < len(args) {
+ 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()