shazow / ssh-chat

Chat over SSH.

Home Page:https://shazow.net/posts/ssh-how-does-it-even/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fuzzer crash

shazow opened this issue · comments

panic: runtime error: slice bounds out of range [:6] with capacity 2
goroutine 227357 [running]:
github.com/shazow/ssh-chat/sshd/terminal.(*Terminal).moveCursorToPos(0xc0001c7680, 0x6)
        /home/shazow/projects/ssh-chat/sshd/terminal/terminal.go:267 +0x154
github.com/shazow/ssh-chat/sshd/terminal.(*Terminal).setLine(0xc0001c7680, 0xc0008c9498, 0x2, 0x2, 0x6)
        /home/shazow/projects/ssh-chat/sshd/terminal/terminal.go:357 +0xf4
github.com/shazow/ssh-chat/sshd/terminal.(*Terminal).handleKey(0xc0001c7680, 0x9, 0x100, 0x0, 0x9)
        /home/shazow/projects/ssh-chat/sshd/terminal/terminal.go:620 +0x892
github.com/shazow/ssh-chat/sshd/terminal.(*Terminal).readLine(0xc0001c7680, 0xc00002d400, 0x0, 0xc000df1560, 0xc000c17ca8)
        /home/shazow/projects/ssh-chat/sshd/terminal/terminal.go:806 +0x148
github.com/shazow/ssh-chat/sshd/terminal.(*Terminal).ReadLine(0xc0001c7680, 0x0, 0x0, 0x0, 0x0)
        /home/shazow/projects/ssh-chat/sshd/terminal/terminal.go:763 +0x76
github.com/shazow/ssh-chat.(*Host).Connect(0xc0000882c0, 0xc0001c7680)
        /home/shazow/projects/ssh-chat/host.go:187 +0x545
github.com/shazow/ssh-chat/sshd.(*SSHListener).Serve.func1(0xc00005bbf0, 0x845460, 0xc00000e2b8)
        /home/shazow/projects/ssh-chat/sshd/net.go:72 +0x149
created by github.com/shazow/ssh-chat/sshd.(*SSHListener).Serve
        /home/shazow/projects/ssh-chat/sshd/net.go:65 +0x7d

We have a terminal fork, wonder if this is fixed upstream.

cc @Umarovm, in case you wanna try to fix it

Did some mitigation here, not sure if that's the core problem though: 0eebb64