Skip to content

Commit 050d8f8

Browse files
committed
fix dsn parsing
1 parent 3de0a02 commit 050d8f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: dsn.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ func ParseDSN(dsn string) (cfg *Config, err error) {
414414
if dsn[j] == '@' {
415415
// username[:password]
416416
// Find the first ':' in dsn[:j]
417-
for k = range j {
417+
for k = 0; k < j; k++ { // We cannot use k = range j here, because we use dsn[:k] below
418418
if dsn[k] == ':' {
419419
cfg.Passwd = dsn[k+1 : j]
420420
break

0 commit comments

Comments
 (0)