diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2014-03-12 17:27:22 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2014-03-12 17:28:13 +0530 |
commit | c44496df2f090a56d3bf75df930592dac6bba46f (patch) | |
tree | 8524bc2814c863852dd3622840acc42cb9861326 /nscd | |
parent | 27c7220a483bda576533aa9a0a9b42175644b1a1 (diff) | |
download | glibc-c44496df2f090a56d3bf75df930592dac6bba46f.zip glibc-c44496df2f090a56d3bf75df930592dac6bba46f.tar.gz glibc-c44496df2f090a56d3bf75df930592dac6bba46f.tar.bz2 |
Provide correct buffer length to netgroup queries in nscd (BZ #16695)
The buffer to query netgroup entries is allocated sufficient space for
the netgroup entries and the key to be appended at the end, but it
sends in an incorrect available length to the NSS netgroup query
functions, resulting in overflow of the buffer in some special cases.
The fix here is to factor in the key length when sending the available
buffer and buffer length to the query functions.
Diffstat (limited to 'nscd')
-rw-r--r-- | nscd/netgroupcache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c index 426d3c5..5ba1e1f 100644 --- a/nscd/netgroupcache.c +++ b/nscd/netgroupcache.c @@ -202,7 +202,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, { int e; status = getfct.f (&data, buffer + buffilled, - buflen - buffilled, &e); + buflen - buffilled - req->key_len, &e); if (status == NSS_STATUS_RETURN || status == NSS_STATUS_NOTFOUND) /* This was either the last one for this group or the |