Skip to content

Autocomplete crashes cmk if at the end of uuid string #195

@borisstoyanov

Description

@borisstoyanov

When you are towards the end of the uuid string and tab to auto complete it crashes cmk.

Image

out of range exception appears:

(localcloud) 🐱 >
panic: runtime error: slice bounds out of range [:22] with capacity 20

goroutine 19 [running]:
github.com/chzyer/readline.(*opCompleter).truncateBufferAfterLastEqual(0xc0000e7490, {0xc0014fa040, 0x14, 0x14})
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/complete.go:54 +0x1e9
github.com/chzyer/readline.(*opCompleter).writeRunes(0xc0000e7490, {0xc0014fa000, 0x10000c0000efc28?, 0x24})
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/complete.go:70 +0x8d
github.com/chzyer/readline.(*opCompleter).OnComplete(0xc0000e7490)
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/complete.go:125 +0x1b2
github.com/chzyer/readline.(*Operation).ioloop(0xc0000e73b0)
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/operation.go:180 +0xd0f
created by github.com/chzyer/readline.NewOperation in goroutine 1
	/home/shwstppr/lab/shapeblue/cloudstack-cloudmonkey/vendor/github.com/chzyer/readline/operation.go:88 +0x2c6

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