]> git.ipfire.org Git - thirdparty/util-linux.git/commit
more: fix floating point exception core dump
authorSami Kerola <kerolasa@iki.fi>
Wed, 19 May 2021 19:23:48 +0000 (20:23 +0100)
committerSami Kerola <kerolasa@iki.fi>
Wed, 19 May 2021 19:23:48 +0000 (20:23 +0100)
commitec4153cc28c718e064a1992a76a63ec7696d33a6
treeb79a1f35f9cb1495b9b22a2fde06584db7063771
parent842ec4ce6bf183cdb26b404fd0b3a9a87ec69507
more: fix floating point exception core dump

Make the code avoid divided by zero.  This can happen when file has content
but is zero in size.  Such files can be found from procfs, possibly some
other pseudo-filesystems.  To reproduce the issue run the following.

    $ more /proc/crypto
    ...
    Floating point exception (core dumped)

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