summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/xdr/src/xdr-generic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/xdr/src/xdr-generic.c b/rpc/xdr/src/xdr-generic.c
index 5d5cf7197fb..6726beb33eb 100644
--- a/rpc/xdr/src/xdr-generic.c
+++ b/rpc/xdr/src/xdr-generic.c
@@ -127,7 +127,7 @@ xdr_vector_round_up (struct iovec *vec, int vcount, uint32_t count)
round_count = xdr_length_round_up (count, 1048576);
round_count -= count;
- if (round_count == 0)
+ if (round_count == 0 || vcount <= 0)
return;
vec[vcount-1].iov_len += round_count;