mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
Update.
1998-03-11 Ulrich Drepper <drepper@cygnus.com> * nss/nss_db/db-XXX.c (lookup): Copy data to safe place before parsing it.
This commit is contained in:
parent
bc526b60ee
commit
3d76e77847
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user