]> 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>
Tue, 29 Mar 2016 09:27:32 +0000 (11:27 +0200)
commita6033052d08027f745867e5e346852da1959226c
tree7223be0f10e3468f5c44ef9c259ec0a36f30ae85
parent0791f91dff9a77263fa8173b143d854cad902c6d
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.
ChangeLog
nss/nss_db/db-XXX.c