mirror of
https://github.com/openharmony/third_party_libxml2.git
synced 2026-08-24 23:31:27 -04:00
fixed abceb70 from https://gitee.com/fang-yunzhong/third_party_libxml2/pulls/33
安全漏洞[CVE-2022-29824] 完善
Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
@@ -172,8 +172,8 @@ xmlBufCreateSize(size_t size) {
|
||||
ret->error = 0;
|
||||
ret->buffer = NULL;
|
||||
ret->alloc = xmlBufferAllocScheme;
|
||||
ret->size = (size ? size+1 : 0); /* +1 for ending null */
|
||||
ret->compat_size = (int) ret->size;
|
||||
ret->size = (size ? size + 1 : 0); /* +1 for ending null */
|
||||
ret->compat_size = (ret->size > INT_MAX ? INT_MAX : ret->size);
|
||||
if (ret->size){
|
||||
ret->content = (xmlChar *) xmlMallocAtomic(ret->size * sizeof(xmlChar));
|
||||
if (ret->content == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user