Skip to content

Commit

Permalink
* nss/nsswitch.c (__nss_lookup_function): En/Decrypt cached
Browse files Browse the repository at this point in the history
	function pointers.
  • Loading branch information
Ulrich Drepper committed Apr 26, 2009
1 parent 82a1a4d commit 4ec77f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2009-04-26 Ulrich Drepper <drepper@redhat.com>

* nss/nsswitch.c (__nss_lookup_function): En/Decrypt cached
function pointers.

2009-04-26 Jakub Jelinek <jakub@redhat.com>

* sysdeps/ieee754/dbl-64/s_tan.c (tan): Fix -Wsequence-point warnings.
Expand Down
10 changes: 7 additions & 3 deletions nss/nsswitch.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1996-1999, 2001-2006, 2007 Free Software Foundation, Inc.
/* Copyright (C) 1996-1999, 2001-2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
Expand Down Expand Up @@ -300,8 +300,11 @@ __nss_lookup_function (service_user *ni, const char *fct_name)

found = __tsearch (&fct_name, &ni->known, &known_compare);
if (*found != &fct_name)
/* The search found an existing structure in the tree. */
result = ((known_function *) *found)->fct_ptr;
{
/* The search found an existing structure in the tree. */
result = ((known_function *) *found)->fct_ptr;
PTR_DEMANGLE (result);
}
else
{
/* This name was not known before. Now we have a node in the tree
Expand Down Expand Up @@ -424,6 +427,7 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
/* Remember function pointer for later calls. Even if null, we
record it so a second try needn't search the library again. */
known->fct_ptr = result;
PTR_MANGLE (known->fct_ptr);
}
}

Expand Down

0 comments on commit 4ec77f7

Please sign in to comment.