HomeFreeBSD

getusershell: don't write past end of line buffer reading local shells

Description

getusershell: don't write past end of line buffer reading local shells

_local_initshells did not reset cp to the beginning of the line buffer
for every iteration that it called fgets(3), leading to writing past the
end of line with fairly long /etc/shells or excessively long line
lengths. Correct this by properly resetting cp.

PR: 192528
Submitted by: Kyle Evans <kevans91@ksu.edu>
Reviewed by: cem, jilles
Differential Revision: https://reviews.freebsd.org/D10690

Details

Provenance
emasteAuthored on
Reviewer
cem
Differential Revision
D10690: getusershell(3): Don't write past the end of line buffer reading local shells
Parents
rS318303: Style.
Branches
Unknown
Tags
Unknown