2
0

Add arguments count check to execParamsAndPreparedPrefix

This commit is contained in:
malstoun
2020-01-03 19:43:19 +03:00
parent 9cb58fc969
commit 8dc8431ef9
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -501,6 +501,10 @@ func (c *Conn) execSimpleProtocol(ctx context.Context, sql string, arguments []i
}
func (c *Conn) execParamsAndPreparedPrefix(sd *pgconn.StatementDescription, arguments []interface{}) error {
if len(sd.ParamOIDs) != len(arguments) {
return errors.Errorf("expected %d arguments, got %d", len(sd.ParamOIDs), len(arguments))
}
c.eqb.Reset()
args, err := convertDriverValuers(arguments)