[xml] Bug in 2.4.3 in xmlEncodeEntitiesReentrant


There is a bug in xmlEncodeEntitiesReentrant, in versions of libxml2 up
to at least 2.4.3. I'm not sure what the right cure is, though.

The problem is that when it hits data that does not make sense as UTF8
(assuming the current coding is UTF8) it does a "continue" round the
loop without changing the current character point - an infinite loop.

For XML (with its anything that isn't exiactly right is 100% wrong
policy) I think it is clear the routine should simply exit, although it
is not obvious how it should return an error status back to the caller
(return a NULL pointer, maybe). For HTML things are, as usual, greyer.

*** Nasty bodge alert ***
To get around my current problem I am simply incrementing the current
character pointer before the continue statement. This stops the lockup,
and since the data stream was bad the result is really no worse. The is
most certainly not the right thing, though.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]