Skip to content

Commit

Permalink
Remove aliasing problems in NIS code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Dec 3, 2011
1 parent 9bea347 commit 3a96549
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2011-12-02 Ulrich Drepper <drepper@gmail.com>

* nis/nis_findserv.c (__nis_findfastest_with_timeout): Avoid aliasing
problem.

* nscd/aicache.c (addhstaiX): Avoid unused variable warning.

2011-11-29 Joseph Myers <joseph@codesourcery.com>
Expand Down
6 changes: 4 additions & 2 deletions nis/nis_findserv.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1997, 1998, 2000, 2001, 2010 Free Software Foundation, Inc.
/* Copyright (C) 1997, 1998, 2000, 2001, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
Expand Down Expand Up @@ -175,7 +175,9 @@ __nis_findfastest_with_timeout (dir_binding *bind,
(xdrproc_t) xdr_void, (caddr_t) 0,
*timeout);
if (RPC_SUCCESS == rc) {
fastest = *((u_int32_t *) (cu->cu_inbuf)) - xid_seed;
u_int32_t val;
memcpy (&val, cu->cu_inbuf, sizeof (u_int32_t));
fastest = val - xid_seed;
if (fastest < pings_count) {
bind->server_used = pings[fastest].server_nr;
bind->current_ep = pings[fastest].server_ep;
Expand Down

0 comments on commit 3a96549

Please sign in to comment.