Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix copying external entity from an ext_ent_handler handler
With libxml2-2.12.0 and perl-5.38.0 t/44extent.t failed: $ perl -Iblib/{lib,arch} ./t/44extent.t 1..7 Entity: line 1: parser error : Char 0x0 out of allowed range pseudoroot ^ Entity: line 1: parser error : PCDATA invalid Char value 0 pseudoroot ^ [...] :8: parser error : Entity 'b' failed to parse <b>&b;</b> ^ # Looks like your test exited with 2 before it could output anything. The cause was xmlParserInputBufferCreateMem() which does not copy a supplied buffer. A string returned by the ext_ent_handler handler. As a result, libxml2 read from a deallocated memory parsing random garbage. This patch fixes it by copying the string with xmlParserInputBufferPush(). shlomif#81
- Loading branch information