summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2012-06-20 14:06:24 +0200
committerAnand Avati <avati@redhat.com>2012-07-02 16:27:10 -0700
commit434cf66b5ad85c659091139919bb4805b0a6ff08 (patch)
tree6aef6cde71c36d1155a48cf9793d28981b5318c8 /rpc
parentb8bc3adfd943071bdab2ed186736f99d39397576 (diff)
xdr_vector_round_up: don't let vcount <= 0 cause invalid array reference
Change-Id: I6a69f20fddb7271fe47f80acb97d2198e9998ccc BUG: 789278 Signed-off-by: Jim Meyering <meyering@redhat.com> Reviewed-on: http://review.gluster.com/3605 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'rpc')
-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;