aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-03-11 11:09:56 +0000
committerUlrich Drepper <drepper@redhat.com>1998-03-11 11:09:56 +0000
commit3d76e7784700c20fc222920b2a22baba006daa15 (patch)
tree7a44d4b9a084cf4b9ef6e44555a7ce8840f2d681
parentbc526b60ee5c7cc9fe0540c94d72caf486a41675 (diff)
downloadglibc-3d76e7784700c20fc222920b2a22baba006daa15.zip
glibc-3d76e7784700c20fc222920b2a22baba006daa15.tar.gz
glibc-3d76e7784700c20fc222920b2a22baba006daa15.tar.bz2
Update.
1998-03-11 Ulrich Drepper <drepper@cygnus.com> * nss/nss_db/db-XXX.c (lookup): Copy data to safe place before parsing it.
-rw-r--r--ChangeLog5
-rw-r--r--elf/dl-lookup.c2
-rw-r--r--nss/nss_db/db-XXX.c13
3 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 80619c5..9b63b7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1998-03-11 Ulrich Drepper <drepper@cygnus.com>
+
+ * nss/nss_db/db-XXX.c (lookup): Copy data to safe place before
+ parsing it.
+
1998-03-11 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Use
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index b994ef7..9a2a105 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -402,7 +402,7 @@ _dl_lookup_versioned_symbol_skip (const char *undef_name,
char buf[sizeof undefined_msg + len];
__mempcpy (__mempcpy (buf, undefined_msg, sizeof undefined_msg - 1),
undef_name, len + 1);
- _dl_signal_error (0, (reference_namee && reference_name[0]
+ _dl_signal_error (0, (reference_name && reference_name[0]
? reference_name
: (_dl_argv[0] ?: "<main program>")), buf);
}
diff --git a/nss/nss_db/db-XXX.c b/nss/nss_db/db-XXX.c
index 1340b77..62c7a25 100644
--- a/nss/nss_db/db-XXX.c
+++ b/nss/nss_db/db-XXX.c
@@ -1,5 +1,5 @@
/* Common code for DB-based databases in nss_db module.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -176,10 +176,19 @@ lookup (const DBT *key, struct STRUCTURE *result,
H_ERRNO_SET (HOST_NOT_FOUND);
status = NSS_STATUS_NOTFOUND;
}
+ else if (buflen < value.size)
+ {
+ /* No room to copy the data to. */
+ *errnop = ERANGE;
+ H_ERRNO_SET (NETDB_INTERNAL);
+ status = NSS_STATUS_TRYAGAIN;
+ }
else
{
+ /* Copy the result to a safe place. */
+ p = (char *) memcpy (buffer, value.data, value.size);
+
/* Skip leading blanks. */
- p = (char *) value.data;
while (isspace (*p))
++p;