mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-02-01 00:03:15 +08:00
The `connectWithDSN` func used `db.Exec()` which implicitly uses `context.Background()`[1]. This caused the registered "nucleitcp" dialer callback to receive a ctx missing the `executionId`, leading to a panic during type assertion. Refactor `connectWithDSN` to accept `executionId` explicitly and use it to create a `context` for `db.PingContext()` (yeah, instead of `db.Exec()`). And, add a defensive check in the dialer callback to handle nil values gracefully. Fixes #6733 regression introduced in #6296. [1]: "Exec uses `context.Background` internally" - https://pkg.go.dev/database/sql#DB.Exec. Signed-off-by: Dwi Siswanto <git@dw1.io>