bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sunrpc/xdr_rec.c broken on 64-bit archs?


From: Ulrich Weigand
Subject: sunrpc/xdr_rec.c broken on 64-bit archs?
Date: Tue, 6 Feb 2001 03:02:01 +0100 (MET)

Hello,

it appears that sunrpc/xdr_rec.c is broken on 64-bit architectures.
The routine set_input_fragment contains this code:

  u_long header;
 
  if (! get_input_bytes (rstrm, (caddr_t)&header, BYTES_PER_XDR_UNIT))
    return FALSE;

Now, unless I completely misunderstood the code, the
BYTES_PER_XDR_UNIT constant is supposed to equal 4 on 
every architecture.  However, 'u_long' occupies of 
course 8 bytes on 64-bit architectures, which means that
'header' will be incompletely initialized (especially 
problematic with big endian byte order) ...

This causes weird behaviour of portmap on IBM zSeries ;-)  
Changing the type of header to u_int32_t fixes portmap ...

It would appear an obvious bug, were it not for the fact
that it seems to have been unnoticed for a long time; the
same code is (at least) in versions 2.2.1, 2.2.0 and 2.1.3.
Shouldn't Alpha have had the same problem, or am I missing 
something here?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]