Skip to content

[mcfish]合成装备功能,选择鱼竿流程未对输入值进行验证,导致数组越界 #922

@vatebur

Description

@vatebur

报错信息

ERRO[0985] [bot] execute handler err: runtime error: index out of range [6] with length 6
goroutine 22443 [running]:
runtime/debug.Stack()
        runtime/debug/stack.go:24 +0x65
github.com/wdvxdr1123/ZeroBot.match.func2.1.1()
        github.com/wdvxdr1123/ZeroBot@v1.7.5-0.20240505070304-562ffeb33dcd/bot.go:253 +0x45
panic({0x103c1a0, 0xc002225f50})
        runtime/panic.go:884 +0x213
github.com/FloatTech/ZeroBot-Plugin/plugin/mcfish.init.3.func4(0xc001f0ab90)
        github.com/FloatTech/ZeroBot-Plugin/plugin/mcfish/pole.go:448 +0x15ed
github.com/wdvxdr1123/ZeroBot.match.func2.1()
        github.com/wdvxdr1123/ZeroBot@v1.7.5-0.20240505070304-562ffeb33dcd/bot.go:256 +0x68
created by github.com/wdvxdr1123/ZeroBot.match.func2
        github.com/wdvxdr1123/ZeroBot@v1.7.5-0.20240505070304-562ffeb33dcd/bot.go:249 +0xaa 

复现演示:
只有0-5号鱼竿时,输入不存在的6号竿,会引起报错。

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions