]> git.ipfire.org Git - thirdparty/glibc.git/commit
nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]
authorFlorian Weimer <fweimer@redhat.com>
Tue, 29 Mar 2016 09:27:32 +0000 (11:27 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 9 May 2016 08:56:22 +0000 (10:56 +0200)
commit28a87e027450b66faf1a431fc62779297c760e29
tree74aba6f3daf07bd24174ab572b2de2b08924fd05
parent5769d5d17cdb4770f1e08167b76c1684ad4e1f73
nss_db: Propagate ERANGE error if parse_line fails [BZ #19837]

Reproducer (needs to run as root):

perl -e \
  'print "large:x:999:" . join(",", map {"user$_"} (1 .. 135))."\n"' \
  >> /etc/group
cd /var/db
make
getent -s db group

After the fix, the last command should list the "large" group.

The magic number 135 has been chosen so that the line is shorter than
1024 bytes, but the pointers required to encode the member array will
cross the threshold, triggering the bug.

(cherry picked from commit a6033052d08027f745867e5e346852da1959226c)
ChangeLog
nss/nss_db/db-XXX.c