1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/lib/libc
Bill Paul acbf996600 In clntudp_call(), it is possible that xdr_replymsg() might fail
partway through its attempt to decode the result structure sent by
the server. If this happens, it can leave the result partially
populated with dynamically allocated memory. In this event, the
xdr_replymsg() failure is detected and RPC_CANTDECODERES is returned,
but the memory in the partially populated result struct is not
free()d.

The end result is that memory is leaked when an RPC_CANTDECODERES
error occurs. (This condition can occur if a CLIENT * handle is created
using clntudp_bufcreate() with a receive buffer size that is too small
to handle the result sent by the server.)

Fixed by setting reply_xdrs.x_op to XDR_FREE and calling
xdr_replymsg() again to free the memory if an RPC_CANTDECODERES error
is detected.

I suspect that the clnt_tcp.c, clnt_unix.c and clnt_raw.c modules
may ha a similar problem, but I haven't duplicated the condition with
those yet.

Found by: dbmalloc
1997-10-26 18:47:31 +00:00
..
amd64 Removed bogus .PATH statement. 1997-10-16 14:41:25 +00:00
compat-43 Sorted lists. 1997-10-21 08:41:15 +00:00
db Sorted lists. 1997-10-21 08:41:15 +00:00
gen Change L_SET to SEEK_SET for POSIX compliance. 1997-10-26 00:41:51 +00:00
gmon Removed the subdirectory paths from the definitions of MAN[1-9]. They 1997-10-15 16:16:41 +00:00
i386 Removed unused file. It just forces a return value of 0 on success 1997-10-18 13:59:48 +00:00
locale Sorted lists. 1997-10-21 08:41:15 +00:00
net Sorted lists. 1997-10-21 08:41:15 +00:00
nls Removed the subdirectory paths from the definitions of MAN[1-9]. They 1997-10-15 16:16:41 +00:00
quad Changed all paths to be relative to src/lib instead of src/lib/libc 1997-05-03 03:50:06 +00:00
regex Removed the subdirectory paths from the definitions of MAN[1-9]. They 1997-10-15 16:16:41 +00:00
rpc In clntudp_call(), it is possible that xdr_replymsg() might fail 1997-10-26 18:47:31 +00:00
stdio Sorted lists. 1997-10-21 08:41:15 +00:00
stdlib Sorted lists. 1997-10-21 08:41:15 +00:00
stdtime Typo. 1997-10-26 10:37:35 +00:00
string Sorted lists. 1997-10-21 08:41:15 +00:00
sys Document EINVAL as a possible return value from open(2). 1997-10-22 07:29:13 +00:00
xdr Removed the subdirectory paths from the definitions of MAN[1-9]. They 1997-10-15 16:16:41 +00:00
yp Use ${DESTDIR} correctly in front of absolute paths. 1997-05-23 08:24:00 +00:00
Makefile Use ${DESTDIR} correctly in front of absolute paths. 1997-05-23 08:24:00 +00:00
Makefile.inc Handle machine-dependent (m-d) (string) sources more automatically. 1997-10-16 13:46:50 +00:00