xdrgen: Fix return code checking in built-in XDR decoders
xdr_stream_encode_u32() returns XDR_UNIT on success. xdr_stream_decode_u32() returns zero or -EMSGSIZE, but never XDR_UNIT. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
{% if annotate %}
|
||||
/* member {{ name }} (variable-length array) */
|
||||
{% endif %}
|
||||
if (xdr_stream_decode_u32(xdr, &ptr->{{ name }}.count) != XDR_UNIT)
|
||||
if (xdr_stream_decode_u32(xdr, &ptr->{{ name }}.count) < 0)
|
||||
return false;
|
||||
{% if maxsize != "0" %}
|
||||
if (ptr->{{ name }}.count > {{ maxsize }})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% if annotate %}
|
||||
/* member {{ name }} (variable-length array) */
|
||||
{% endif %}
|
||||
if (xdr_stream_decode_u32(xdr, &ptr->{{ name }}.count) != XDR_UNIT)
|
||||
if (xdr_stream_decode_u32(xdr, &ptr->{{ name }}.count) < 0)
|
||||
return false;
|
||||
{% if maxsize != "0" %}
|
||||
if (ptr->{{ name }}.count > {{ maxsize }})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% if annotate %}
|
||||
/* member {{ name }} (variable-length array) */
|
||||
{% endif %}
|
||||
if (xdr_stream_decode_u32(xdr, &count) != XDR_UNIT)
|
||||
if (xdr_stream_decode_u32(xdr, &count) < 0)
|
||||
return false;
|
||||
if (count > {{ maxsize }})
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user