mirror of
https://github.com/reactos/reactos.git
synced 2025-06-13 09:58:37 +00:00
[LIBXML2] Update to version 2.9.7. CORE-14291
This commit is contained in:
parent
b97f0a8fed
commit
fc82f8e2e3
52 changed files with 1978 additions and 2458 deletions
27
sdk/lib/3rdparty/libxml2/xmlmemory.c
vendored
27
sdk/lib/3rdparty/libxml2/xmlmemory.c
vendored
|
@ -111,7 +111,7 @@ typedef struct memnod {
|
|||
|
||||
#define MAX_SIZE_T ((size_t)-1)
|
||||
|
||||
#define CLIENT_2_HDR(a) ((MEMHDR *) (((char *) (a)) - RESERVE_SIZE))
|
||||
#define CLIENT_2_HDR(a) ((void *) (((char *) (a)) - RESERVE_SIZE))
|
||||
#define HDR_2_CLIENT(a) ((void *) (((char *) (a)) + RESERVE_SIZE))
|
||||
|
||||
|
||||
|
@ -172,6 +172,13 @@ xmlMallocLoc(size_t size, const char * file, int line)
|
|||
|
||||
TEST_POINT
|
||||
|
||||
if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xmlMallocLoc : Unsigned overflow\n");
|
||||
xmlMemoryDump();
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
p = (MEMHDR *) malloc(RESERVE_SIZE+size);
|
||||
|
||||
if (!p) {
|
||||
|
@ -243,7 +250,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
|
|||
|
||||
if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xmlMallocAtomicLoc : Unsigned overflow prevented\n");
|
||||
"xmlMallocAtomicLoc : Unsigned overflow\n");
|
||||
xmlMemoryDump();
|
||||
return(NULL);
|
||||
}
|
||||
|
@ -352,6 +359,13 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line)
|
|||
#endif
|
||||
xmlMutexUnlock(xmlMemMutex);
|
||||
|
||||
if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xmlReallocLoc : Unsigned overflow\n");
|
||||
xmlMemoryDump();
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
tmp = (MEMHDR *) realloc(p,RESERVE_SIZE+size);
|
||||
if (!tmp) {
|
||||
free(p);
|
||||
|
@ -473,7 +487,7 @@ xmlMemFree(void *ptr)
|
|||
|
||||
error:
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xmlMemFree(%lX) error\n", (unsigned long) ptr);
|
||||
"xmlMemFree(%p) error\n", ptr);
|
||||
xmlMallocBreakpoint();
|
||||
return;
|
||||
}
|
||||
|
@ -499,6 +513,13 @@ xmlMemStrdupLoc(const char *str, const char *file, int line)
|
|||
if (!xmlMemInitialized) xmlInitMemory();
|
||||
TEST_POINT
|
||||
|
||||
if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xmlMemStrdupLoc : Unsigned overflow\n");
|
||||
xmlMemoryDump();
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
p = (MEMHDR *) malloc(RESERVE_SIZE+size);
|
||||
if (!p) {
|
||||
goto error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue