]> git.ipfire.org Git - thirdparty/util-linux.git/commit
setterm: segfault with long dump file name
authorSami Kerola <kerolasa@iki.fi>
Sat, 2 Apr 2011 20:56:50 +0000 (22:56 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Apr 2011 08:59:17 +0000 (10:59 +0200)
commit2971543625817182ec009f97f93a2157c6c09fed
treef71fae765d88ed3afd68149ea41afc6f9857dac9
parenta29e40cad5cbb5edf219d42d80acdd4f62a28a8c
setterm: segfault with long dump file name

The patch will make too long path to be truncated to MAX_PATH
lenght. If user supplies too long file name that is caught at
fopen. Some users might find this unintuitive, so the altered
behavior will be mantioned in manual page.

Bug in earlier version was visible with a command bellow.

setterm -dump -file $(for i in $(seq 254); do printf x ; done)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
term-utils/setterm.c