Skip to contentSkip to conversation

libtirpc: add missing boundary restriction to xdr_rpc_gss_unwrap_data

PATCH New Olga Kornievskaia 1 participant 1 message Nov 9

Subsystems (2)
lore
Share & tools
lore

Olga Kornievskaia

author reviewer
#0 lore raw

PATCH 1/1 libtirpc: add missing boundary restriction to xdr_rpc_gss_unwrap_data

Add a boundary restriction to the xdr_rpc_gss_buf() call for the RPCSEC_GSS_SVC_PRIVACY case.

Fixes 65d27459fe56 ("libtirpc: Bound maxsize in xdr_rpc_gss_unwrap_data() decode calls"
---
 src/authgss_prot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/authgss_prot.c +1 -1
index c7de1fd..620b294 100644
@@ -254,7 +254,7 @@ xdr_rpc_gss_unwrap_data(XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr,
 	}
 	else if (svc == RPCSEC_GSS_SVC_PRIVACY) {
 		/* Decode databody_priv. */
-		if (!xdr_rpc_gss_buf(xdrs, &wrapbuf, (u_int)-1)) {
+		if (!xdr_rpc_gss_buf(xdrs, &wrapbuf, RPCSEC_GSS_MAX_UNWRAP)) {
 			LIBTIRPC_DEBUG(1, ("xdr_rpc_gss_unwrap_data: decode databody_priv failed"));
 			return (FALSE);
 		}
Signature · 1 line
2.52.0