mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-07 22:19:12 +00:00
Fix two integer overflows
This commit is contained in:
parent
bb1fd81b98
commit
2cac066cf6
1 changed files with 10 additions and 1 deletions
|
@ -6287,8 +6287,13 @@ poolGrow(STRING_POOL *pool)
|
|||
}
|
||||
}
|
||||
if (pool->blocks && pool->start == pool->blocks->s) {
|
||||
BLOCK *temp;
|
||||
int blockSize = (int)(pool->end - pool->start)*2;
|
||||
BLOCK *temp = (BLOCK *)
|
||||
|
||||
if (blockSize < 0)
|
||||
return XML_FALSE;
|
||||
|
||||
temp = (BLOCK *)
|
||||
pool->mem->realloc_fcn(pool->blocks,
|
||||
(offsetof(BLOCK, s)
|
||||
+ blockSize * sizeof(XML_Char)));
|
||||
|
@ -6303,6 +6308,10 @@ poolGrow(STRING_POOL *pool)
|
|||
else {
|
||||
BLOCK *tem;
|
||||
int blockSize = (int)(pool->end - pool->start);
|
||||
|
||||
if (blockSize < 0)
|
||||
return XML_FALSE;
|
||||
|
||||
if (blockSize < INIT_BLOCK_SIZE)
|
||||
blockSize = INIT_BLOCK_SIZE;
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue