diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-04-13 17:29:41 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-04-23 14:52:57 -0700 |
commit | 29f2de478cc6a475e6ae760d9cbe7ac847e9d79c (patch) | |
tree | 621fbb33e6e3de20f7c1b59a98e181c7b50b4796 /rpc/rpc-lib | |
parent | 4c9e8fad23836d87b0c4327e990c789630fe5b97 (diff) |
core: coverity issues fixed
this is not a complete set of issues getting fixed. Will
address other issues in another patch.
Change-Id: Ib01c7b11b205078cc4d0b3f11610751e32d14b69
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 789278
Reviewed-on: http://review.gluster.com/3145
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r-- | rpc/rpc-lib/src/rpcsvc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index a4f74d8b5ae..b64c43f0e75 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -313,7 +313,9 @@ rpcsvc_request_init (rpcsvc_t *svc, rpc_transport_t *trans, req->msg[0] = progmsg; req->iobref = iobref_ref (msg->iobref); if (msg->vectored) { - for (i = 1; i < msg->count; i++) { + /* msg->vector[2] is defined in structure. prevent a + out of bound access */ + for (i = 1; i < min (msg->count, 2); i++) { req->msg[i] = msg->vector[i]; } } |