add -Wshorten-64-to-32 for share

This commit is contained in:
xuhuleon
2023-02-07 00:40:01 +08:00
committed by ob-robot
parent 822aaaf7f2
commit c157309bc6
168 changed files with 502 additions and 636 deletions

View File

@ -545,12 +545,12 @@ OB_INLINE int ObStorageDatum::from_buf_enhance(const char *buf, const int64_t bu
{
int ret = common::OB_SUCCESS;
if (OB_UNLIKELY(nullptr == buf || buf_len < 0)) {
if (OB_UNLIKELY(nullptr == buf || buf_len < 0 || buf_len > UINT32_MAX)) {
ret = OB_INVALID_ARGUMENT;
STORAGE_LOG(WARN, "Invalid argument to transfer from buf", K(ret), KP(buf), K(buf_len));
} else {
reuse();
len_ = buf_len;
len_ = static_cast<uint32_t>(buf_len);
if (buf_len > 0) {
ptr_ = buf;
}