Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oss_get_sorted_uploaded_part函数存在内存溢出 #96

Closed
qiuyuhang opened this issue Mar 15, 2021 · 1 comment
Closed

oss_get_sorted_uploaded_part函数存在内存溢出 #96

qiuyuhang opened this issue Mar 15, 2021 · 1 comment

Comments

@qiuyuhang
Copy link

    oss_upload_part_t *part_arr = NULL;
... ...
    // 这里存在溢出,应该为sizeof(oss_upload_part_t)。
    part_arr = aos_palloc(parent_pool, OSS_MAX_PART_NUM * sizeof(oss_upload_part_t *)); 
... ...
            oss_upload_part_t upload_part;
            part_arr[part_index++] = upload_part;
@qiuyuhang
Copy link
Author

sizeof(oss_upload_part_t *)=8
sizeof(oss_upload_part_t)=16

OSS_MAX_PART_NUM=10000,使用超过一半的时候就会踩坏内存了。

huiguangjun added a commit that referenced this issue Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants