Skip to content

Conversation

Copy link

Copilot AI commented Dec 30, 2025

Nil pointer panic occurred when switching from -type aqc,miit to -type all with cached data. Types like xlb and qcc are defined in ENSTypes but not implemented in the jobs map, leaving enJob.job nil while execution continued.

Changes

runner/runner.go

  • Early return in processTask when task type not found in jobs/apps map
  • Properly decrements WaitGroup and sends empty result to prevent deadlock

runner/enscan.go

  • Nil check in SearchByKeyWord before calling j.job.AdvanceFilter()
  • Nil check at start of processTask before accessing j.job.GetEnsD() and j.job.GetENMap()

Users no longer need to manually delete enscan.gob cache when switching query modes.

Original prompt

This section details on the original issue you should resolve

<issue_title>type切换查询模式的时候,会出现runtime error内存地址报错</issue_title>
<issue_description>enscan.exe -n 小米 -type aqc,miit
查询后,继续使用-type all查询,会爆出如下错误
Image

必须删除目录下的enscan.gob缓存文件才能继续进行查询

[ERR] 未找到 xlb 任务模式panic: runtime error: invalid memory address or nil pointer dereference[signaL 0xc0000005 code=0x0 addr=0x18 pc=0x8009dc]
goroutine 82 [running]:github.com/wgpsec/ENScan/runner.(EnJob).SearchBykeyWord(Oxc0003ac360, {0xc000032168, Ox18})/home/runner/work/ENScan_G0/ENScan_G0/runner/enscan.go:15 +0x3cgithub.com/wgpsec/ENScan/runner.CE5Job).processTask(Oxc00019b1e0, ff0xc000032168, Ox18},{0x9cb5d1, Ox33, {0x0,0x0}})/home/runner/work/ENScan_G0/ENScan_G0/runner/runner.go:180 +0x587github.com/wgpsec/ENScan/runner.(*ESJob).StartENworkers.func1()/home/runner/work/ENScan_G0/ENScan_G0/runner/runner.go:302 +0xcccreated by github.com/wgpsec/ENScan/runner.(*ESJob).StartENworkers in goroutine 1/home/runner/work/ENScan_G0/ENScan_G0/runner/runner.go:300 +0x66

go版本信息:
go version go1.25.5 windows/amd64</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 30, 2025
Copilot AI and others added 4 commits December 30, 2025 02:16
…ed types

Co-authored-by: keac <16091665+keac@users.noreply.github.com>
Co-authored-by: keac <16091665+keac@users.noreply.github.com>
Co-authored-by: keac <16091665+keac@users.noreply.github.com>
Co-authored-by: keac <16091665+keac@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix runtime error when switching query types Fix nil pointer dereference when using unsupported task types with cache Dec 30, 2025
Copilot AI requested a review from keac December 30, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

type切换查询模式的时候,会出现runtime error内存地址报错

2 participants