Some xdr_XXXX routines in src/rx use osi_alloc() which is defined as returning a char * in rx_misc.c, but do not declare it. Consequently, the function call is considered to return an int which truncates the pointer on systems (e.g. ia64) where an intis shorter than a char *. Affected are xdr_array.c (hence everything calling pr_SNameToId()) and xdr_reference.c.

The attached patch declares osi_alloc by including the "rx.h" file which also deals with the special cases (e.g. the different #define for kernel code).

Remark: somebody has obviously noticed this already and tried to cast the result of osi_alloc using (caddr_t) - I see an xdr_arrayn.c there which has this. BUT: it does not work like that - casting an int to something bigger doesn't recover the previous contents.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland
Phone: +41 22 767 8985       Fax: +41 22 767 7155
--- openafs/src/rx/xdr_array.c.o141     2005-12-14 13:45:31.000000000 +0100
+++ openafs/src/rx/xdr_array.c  2005-12-14 14:46:51.000000000 +0100
@@ -28,6 +28,7 @@
  */
 #include <afsconfig.h>
 #include <afs/param.h>
+#include "rx.h"
 
 RCSID
     ("$Header: /cvs/openafs/src/rx/xdr_array.c,v 1.9.2.1 2004/12/07 06:10:06 
shadow Exp $");
--- openafs/src/rx/xdr_refernce.c.o141  2003-07-16 01:16:13.000000000 +0200
+++ openafs/src/rx/xdr_refernce.c       2005-12-14 14:47:07.000000000 +0100
@@ -28,6 +28,7 @@
  */
 #include <afsconfig.h>
 #include <afs/param.h>
+#include "rx.h"
 
 RCSID
     ("$Header: /cvs/openafs/src/rx/xdr_refernce.c,v 1.6 2003/07/15 23:16:13 
shadow Exp $");

Reply via email to