xdr_mbuf.c: Add a check for the return value for xdrmbuf_getbytes()

The xdrmbuf_getlong() function failed to check for the return
value from xdrmbuf_getbytes().  This could have resulted in
a failure during NFS RPC message processing.

Reviewed by:	rmacklem
MFC after:	2 weeks
Sponsored by:	VersatusHPC
This commit is contained in:
Vinicius Ferrao authored and Rick Macklem committed 2026-11-05 15:58:56 -08:00
1 parent 12f90bbd30
commit cf59649539
1 file changed
+2 -1
+2 -1
View File
@@ -151,7 +151,8 @@ xdrmbuf_getlong(XDR *xdrs, long *lp)
if (p) {
t = *p;
} else {
xdrmbuf_getbytes(xdrs, (char *) &t, sizeof(int32_t));
if (!xdrmbuf_getbytes(xdrs, (char *) &t, sizeof(int32_t)))
return (FALSE);
}
*lp = ntohl(t);