Commit c656a4d5 authored by Anna Schumaker's avatar Anna Schumaker

Revert "SUNRPC: clean up integer overflow check"

This reverts commit e87cf8a2.

This commit was added to silence a tautological comparison warning, but
removing the 'len' value check before calling xdr_inline_decode() is
really not what we want.
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 4506f23e
...@@ -779,7 +779,9 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr, ...@@ -779,7 +779,9 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0)) if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
return -EBADMSG; return -EBADMSG;
p = xdr_inline_decode(xdr, size_mul(len, sizeof(*p))); if (len > SIZE_MAX / sizeof(*p))
return -EBADMSG;
p = xdr_inline_decode(xdr, len * sizeof(*p));
if (unlikely(!p)) if (unlikely(!p))
return -EBADMSG; return -EBADMSG;
if (array == NULL) if (array == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment