fix possible null dereference

Make sure that pLimitN is not `nil` before dereferencing the pointer.
This commit is contained in:
Andreas Gerstmayr 2021-07-12 14:12:17 +02:00
parent 394c4e1f17
commit 33fdc805b1
1 changed files with 1 additions and 1 deletions

View File

@ -314,7 +314,7 @@ func (statement *Statement) genSelectSQL(columnStr string, needLimit, needOrderB
fmt.Fprint(&buf, " LIMIT ", *pLimitN) fmt.Fprint(&buf, " LIMIT ", *pLimitN)
} }
} else if dialect.URI().DBType == schemas.ORACLE { } else if dialect.URI().DBType == schemas.ORACLE {
if statement.Start != 0 || pLimitN != nil { if statement.Start != 0 && pLimitN != nil {
oldString := buf.String() oldString := buf.String()
buf.Reset() buf.Reset()
rawColStr := columnStr rawColStr := columnStr