summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2018-08-22 12:03:04 -0700
committerAmar Tumballi <amarts@redhat.com>2018-08-27 12:31:05 +0000
commitddaa43e6a27ee650bbf8fd6ee731276c98042a67 (patch)
tree1f129936e76d24fe77279b2685fffd07d6cea710 /xlators/cluster
parent1b499e9dfe63ce051a071cacc19e3161b7a32636 (diff)
cluster/ec: Prevent a possible out-of-bounds read
Addresses CID 1370939 In ec_code_x64_epilog(), there is a possibility of reading from an incorrect index of ec_code_x64_regmap array Change-Id: Ib8a228bbe13631188343634b2bde5919cdaab5a4 Updates: bz#789278 Signed-off-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/ec/src/ec-code-x64.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec-code-x64.c b/xlators/cluster/ec/src/ec-code-x64.c
index e94ddd4b155..cfec4b3be7a 100644
--- a/xlators/cluster/ec/src/ec-code-x64.c
+++ b/xlators/cluster/ec/src/ec-code-x64.c
@@ -49,6 +49,7 @@ ec_code_x64_epilog(ec_code_builder_t *builder)
if (builder->regs > 11) {
ec_code_error(builder, EINVAL);
+ return;
}
for (i = builder->regs; i > 7; i--) {
ec_code_intel_op_pop_r(builder, ec_code_x64_regmap[i - 1]);