安全漏洞[CVE-2022-29824] 完善

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong
2022-12-05 15:46:33 +08:00
committed by fyz1019
parent 61bd848112
commit 4c14613a08
+2 -2
View File
@@ -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) {