Fix process_decrease bounds issue

This commit is contained in:
obdev
2023-03-27 14:14:34 +00:00
committed by ob-robot
parent 674e87b495
commit 04efb2a763

View File

@ -848,8 +848,15 @@ int ObSortkeyConditioner::process_key_conditioning(
if (ret != OB_BUF_NOT_ENOUGH) { if (ret != OB_BUF_NOT_ENOUGH) {
LOG_WARN("failed to encode sortkey", K(ret)); LOG_WARN("failed to encode sortkey", K(ret));
} }
} else if (max_buf_len < to_len) {
ret = OB_BUF_NOT_ENOUGH;
LOG_TRACE("no enough memory to do encoding for obnumber", K(ret));
} else if (!param.is_asc_) { } else if (!param.is_asc_) {
process_decrease(to + 1, to_len); if (param.is_nullable_) {
process_decrease(to + 1, to_len - 1);
} else {
process_decrease(to, to_len);
}
} }
return ret; return ret;