提交 d72e2a19 编写于 作者: 盏一 提交者: Ning Yu

Fix array overflow in AO concurrency handling

In the function ao_foreach_extent_file() an array concurrency is used to
store the concurrent levels, its size was AOTupleId_MaxSegmentFileNum,
which equals to (MAX_AOREL_CONCURRENCY - 1).  However the possible index
range is [0, MAX_AOREL_CONCURRENCY - 1], it exceeds the original size of
the array, so an array overflow can happen at runtime.

Fixed by correcting the array size, also define the size with
MAX_AOREL_CONCURRENCY instead of AOTupleId_MaxSegmentFileNum.
Reviewed-by: NZhenghua Lyu <zlv@pivotal.io>
Reviewed-by: NNing Yu <nyu@pivotal.io>
上级 3dbbaa88
......@@ -68,7 +68,7 @@ ao_foreach_extent_file(ao_extent_callback callback, void *ctx)
{
int segno;
int colnum;
int concurrency[AOTupleId_MaxSegmentFileNum];
int concurrency[MAX_AOREL_CONCURRENCY];
int concurrencySize;
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册