From 387fb72ee084aca883b35d37d177958715bffab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 22 Aug 2021 03:18:03 +0200 Subject: l and h get args, no logmem, embed css, php dep --- test/bug/prog.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/bug/prog.c (limited to 'test/bug/prog.c') diff --git a/test/bug/prog.c b/test/bug/prog.c new file mode 100644 index 0000000..2371077 --- /dev/null +++ b/test/bug/prog.c @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include +#include +int main (int argc, char ** argv) { + xmlInitParser(); + htmlDocPtr xmldoc; + char * txtdoc; + struct stat s; + int fd = open(argv[1], O_RDONLY); + htmlParserCtxtPtr c; + stat(argv[1], &s); + txtdoc = mmap(NULL, s.st_size, PROT_READ, MAP_PRIVATE, fd, 0); + xmlInitParser(); + + c = htmlNewParserCtxt(); + xmldoc = htmlCtxtReadMemory(c, txtdoc, strlen(txtdoc), "", NULL, HTML_PARSE_RECOVER); + /* by the way: why/how/when does libxml2 use networking when HTML_PARSE_NOT is not specified? */ + htmlFreeParserCtxt(c); + xmlFreeDoc(xmldoc); + + close(fd); + munmap(txtdoc, s.st_size); + xmlCleanupParser(); + return 0; +} -- cgit v1.2.3