[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30160: cat buffer overflow?

From: Bernhard Voelker
Subject: bug#30160: cat buffer overflow?
Date: Fri, 19 Jan 2018 09:20:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

tag 30160 notabug
close 30160

On 01/18/2018 01:31 PM, Rdrpenguin Minecraft and More wrote:
> If 'cat' is run with a big enough file, say /dev/sda, the terminal gets
> corrupted. This corruption may also extend beyond the terminal.
> Steps to reproduce:
> 1. Run '/bin/cat /dev/sda'.
> 2. Wait from 2 to 3 minutes.
> 3. Ctrl-C to exit.
> 4. Observe corrupted terminal
> This was tested on gnome-terminal in Ubuntu 16.04. It may or may not happen
> in other terminals / flavors, and it may produce different errors too.

It is pretty clear that the terminal is messed up when someone writes random 
data to it.  You're way better of using less(1) to prevent getting potentially
dangerous control sequences to the terminal.
If you really want to display the content of /dev/sda in a terminal, you could
maybe also use cat's -v or -A options, but I wonder if someone really could read
that fast.

Finally, you didn't proof that something is wrong with 'cat'.
Thus I'm closing this as 'not a bug' in our bug tracker.

Have a nice day,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]