Skip to content

Commit a044747

Browse files
methanejulienschmidt
authored andcommitted
Fix index out of range in interpolateParams.
Fixes go-sql-driver#467
1 parent 7fcf04e commit a044747

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

connection.go

+3
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (strin
153153
buf = append(buf, query[i:i+q]...)
154154
i += q
155155

156+
if argPos >= len(args) {
157+
return "", driver.ErrSkip
158+
}
156159
arg := args[argPos]
157160
argPos++
158161

0 commit comments

Comments
 (0)