aboutsummaryrefslogtreecommitdiff
path: root/nscd/nscd-client.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-05-15 21:17:08 -0700
committerUlrich Drepper <drepper@redhat.com>2009-05-15 21:17:08 -0700
commitcfe1fc1013d0e7e4863c974fa0e78891cc0a2ed2 (patch)
tree77134fa880e4dd6db41a701034607e67a4dd9be1 /nscd/nscd-client.h
parent3b1b533bc3239ef6df1e40e0088e7270ac060be6 (diff)
downloadglibc-cfe1fc1013d0e7e4863c974fa0e78891cc0a2ed2.zip
glibc-cfe1fc1013d0e7e4863c974fa0e78891cc0a2ed2.tar.gz
glibc-cfe1fc1013d0e7e4863c974fa0e78891cc0a2ed2.tar.bz2
Robustify libc-side nscd database reader.
The nscd database mapped in processes can change at any time. We have to be more vigilant when it comes to using that memory. Test the data entries are valid in their entire size, don't read data again from memory once we verified it, and make sure the trailing pointer is not going off the deep end.
Diffstat (limited to 'nscd/nscd-client.h')
-rw-r--r--nscd/nscd-client.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/nscd/nscd-client.h b/nscd/nscd-client.h
index 3c9688f..f66a658 100644
--- a/nscd/nscd-client.h
+++ b/nscd/nscd-client.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2007
+/* Copyright (c) 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@@ -329,7 +329,8 @@ static inline int __nscd_drop_map_ref (struct mapped_database *map,
extern struct datahead *__nscd_cache_search (request_type type,
const char *key,
size_t keylen,
- const struct mapped_database *mapped);
+ const struct mapped_database *mapped,
+ size_t datalen);
/* Wrappers around read, readv and write that only read/write less than LEN
bytes on error or EOF. */