Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cat /dev/urandom crashes the terminal #316

Open
thevar1able opened this issue Aug 30, 2021 · 1 comment
Open

cat /dev/urandom crashes the terminal #316

thevar1able opened this issue Aug 30, 2021 · 1 comment

Comments

@thevar1able
Copy link

Steps to reproduce:

cat /dev/urandom

Stacktrace:

panic: runtime error: index out of range [1] with length 1

goroutine 12 [running]:
github.com/liamg/darktile/internal/app/darktile/sixel.(*decoder).processHeader(0xc000052c98, 0x30, 0x556bc20f25e0)
github.com/liamg/darktile/internal/app/darktile/sixel/decoder.go:91 +0x41e
github.com/liamg/darktile/internal/app/darktile/sixel.(*decoder).Decode(0xc000052c98, 0xc001ec6000, 0x556bc1c36d01, 0x100c0001f2fb8, 0x7fa228140338)
github.com/liamg/darktile/internal/app/darktile/sixel/decoder.go:41 +0x31
github.com/liamg/darktile/internal/app/darktile/sixel.Decode(0x556bc2119098, 0xc0001d8000, 0x556bc2119438, 0xc00037ecc4, 0xc0001f2801, 0x7b9, 0x400, 0x540)
github.com/liamg/darktile/internal/app/darktile/sixel/decoder.go:26 +0xf5
github.com/liamg/darktile/internal/app/darktile/termutil.(*Terminal).handleSixel(0xc000117c20, 0xc000706000, 0x2)
github.com/liamg/darktile/internal/app/darktile/termutil/sixel.go:90 +0x238
github.com/liamg/darktile/internal/app/darktile/termutil.(*Terminal).handleANSI(0xc000117c20, 0xc000706000, 0x0)
github.com/liamg/darktile/internal/app/darktile/termutil/ansi.go:39 +0x965
github.com/liamg/darktile/internal/app/darktile/termutil.(*Terminal).process(0xc000117c20)
github.com/liamg/darktile/internal/app/darktile/termutil/terminal.go:206 +0xc5
created by github.com/liamg/darktile/internal/app/darktile/termutil.(*Terminal).Run
github.com/liamg/darktile/internal/app/darktile/termutil/terminal.go:171 +0x205
@awnumar
Copy link

awnumar commented Jan 18, 2023

This is probably expected behaviour. Dumping random data into the terminal isn't safe, write it to a file instead or pipe it into another program

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

No branches or pull requests

2 participants