Lines 14-20
Link Here
|
14 |
#include "libxml.h" |
14 |
#include "libxml.h" |
15 |
|
15 |
|
16 |
#include <string.h> /* for memset() only ! */ |
16 |
#include <string.h> /* for memset() only ! */ |
17 |
|
17 |
#include <limits.h> |
18 |
#ifdef HAVE_CTYPE_H |
18 |
#ifdef HAVE_CTYPE_H |
19 |
#include <ctype.h> |
19 |
#include <ctype.h> |
20 |
#endif |
20 |
#endif |
Lines 6996-7002
xmlBufferResize(xmlBufferPtr buf, unsign
Link Here
|
6996 |
case XML_BUFFER_ALLOC_DOUBLEIT: |
6996 |
case XML_BUFFER_ALLOC_DOUBLEIT: |
6997 |
/*take care of empty case*/ |
6997 |
/*take care of empty case*/ |
6998 |
newSize = (buf->size ? buf->size*2 : size + 10); |
6998 |
newSize = (buf->size ? buf->size*2 : size + 10); |
6999 |
while (size > newSize) newSize *= 2; |
6999 |
while (size > newSize) { |
|
|
7000 |
if (newSize > UINT_MAX / 2) { |
7001 |
xmlTreeErrMemory("growing buffer"); |
7002 |
return 0; |
7003 |
} |
7004 |
newSize *= 2; |
7005 |
} |
7000 |
break; |
7006 |
break; |
7001 |
case XML_BUFFER_ALLOC_EXACT: |
7007 |
case XML_BUFFER_ALLOC_EXACT: |
7002 |
newSize = size+10; |
7008 |
newSize = size+10; |