mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
xmlparse.cpp skip memmove if pool->start (src) is 0
This commit is contained in:
@@ -854,7 +854,7 @@ enum XML_Error XML_Parser::doContent(int startTagLevel, const ENCODING *enc, con
|
|||||||
if (result) return result;
|
if (result) return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
// fall through */
|
// fall through
|
||||||
|
|
||||||
case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
|
case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
|
||||||
if (startElementHandler || endElementHandler)
|
if (startElementHandler || endElementHandler)
|
||||||
@@ -2691,6 +2691,7 @@ static int poolGrow(STRING_POOL *pool)
|
|||||||
pool->blocks=pool->freeBlocks;
|
pool->blocks=pool->freeBlocks;
|
||||||
pool->freeBlocks=tem;
|
pool->freeBlocks=tem;
|
||||||
|
|
||||||
|
if (pool->start)
|
||||||
memmove(pool->blocks->s, pool->start, (pool->end-pool->start)*sizeof(XML_Char));
|
memmove(pool->blocks->s, pool->start, (pool->end-pool->start)*sizeof(XML_Char));
|
||||||
|
|
||||||
pool->ptr=pool->blocks->s+(pool->ptr-pool->start);
|
pool->ptr=pool->blocks->s+(pool->ptr-pool->start);
|
||||||
@@ -2733,7 +2734,8 @@ static int poolGrow(STRING_POOL *pool)
|
|||||||
|
|
||||||
pool->blocks=tem;
|
pool->blocks=tem;
|
||||||
|
|
||||||
memmove(tem->s, pool->start, (pool->ptr-pool->start)*sizeof(XML_Char)); //FIXME: pool->start seems to be a null pointer in some constellations, eg. with disabled pugixml, memmove don't like NULL-pointer for parameter 2
|
if (pool->start)
|
||||||
|
memmove(tem->s, pool->start, (pool->ptr-pool->start)*sizeof(XML_Char));
|
||||||
|
|
||||||
pool->ptr=tem->s+(pool->ptr-pool->start);
|
pool->ptr=tem->s+(pool->ptr-pool->start);
|
||||||
pool->start=tem->s;
|
pool->start=tem->s;
|
||||||
|
Reference in New Issue
Block a user