]> git.ipfire.org Git - thirdparty/util-linux.git/commit
vipw: fix short write handling in copyfile
authorEgor Chelak <egor.chelak@gmail.com>
Thu, 29 Oct 2020 17:06:13 +0000 (19:06 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 13 Nov 2020 11:33:09 +0000 (12:33 +0100)
commit4069e159fc46c98191a9d26a0e6b9ff097c40996
tree70db7daeea268b04f02900af5b1ba20cafc51bc3
parent7a565574a1955aaa35c5b95dd90583c93986417a
vipw: fix short write handling in copyfile

Since `off` and `nr` approach each other, the for-loop ends prematurely
when at least half of the buffer was written.  I think under certain
conditions this could cause the copy to be incomplete.

Signed-off-by: Egor Chelak <egor.chelak@gmail.com>
login-utils/vipw.c