]> 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)
committerEgor Chelak <egor.chelak@gmail.com>
Thu, 29 Oct 2020 17:06:13 +0000 (19:06 +0200)
commit12235ef107ed94d06758b6fc718e18fe421e2b17
tree4abbe8bf20d2a10a146d4a7e7fc8f53c10299fbb
parent9210db64a6e44ba5c6c76446835dd16606b5e79f
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