[rtems commit] rpc: misaligned pointer dereference in clnt_udp.c line 363

Gedare Bloom gedare at rtems.org
Mon Feb 23 17:27:50 UTC 2015


Module:    rtems
Branch:    4.10
Commit:    0f3388d1f3e98f70ebc2f15d015680747b795328
Changeset: http://git.rtems.org/rtems/commit/?id=0f3388d1f3e98f70ebc2f15d015680747b795328

Author:    Jeffrey Hill <johill at lanl.gov>
Date:      Mon Feb 23 12:27:05 2015 -0500

rpc: misaligned pointer dereference in clnt_udp.c line 363

see #2248

---

 cpukit/librpc/src/rpc/clnt_udp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/librpc/src/rpc/clnt_udp.c b/cpukit/librpc/src/rpc/clnt_udp.c
index 369da95..68e085e 100644
--- a/cpukit/librpc/src/rpc/clnt_udp.c
+++ b/cpukit/librpc/src/rpc/clnt_udp.c
@@ -89,13 +89,13 @@ struct cu_data {
 	u_int		   cu_xdrpos;
 	u_int			cu_sendsz;	/* send size */
 	union {
-	  u_int32_t	   *i32;
+	  u_int32_t	   *pi32;
 	  char		   *c;
 	} _cu_outbuf;
 #define cu_outbuf _cu_outbuf.c
 	u_int			cu_recvsz;	/* recv size */
 	union {
-	  u_int32_t	*i32;
+	  u_int32_t	i32;
 	  char		c[1];
 	} _cu_inbuf;
 #define cu_inbuf _cu_inbuf.c
@@ -360,7 +360,7 @@ send_again:
 		if (inlen < sizeof(u_int32_t))
 			continue;
 		/* see if reply transaction id matches sent id */
-		if (*(cu->_cu_inbuf.i32) != *(cu->_cu_outbuf.i32))
+		if ( cu->_cu_inbuf.i32 != *cu->_cu_outbuf.pi32 )
 			continue;
 		/* we now assume we have the proper reply */
 		break;



More information about the vc mailing list