Segmentation fault in xmlTextReaderReadOuterXml on 2.9.9
The latest release of libxml2 triggers an segmentation fault in the spec suit for Crystal's libxml bindings.
The same error reproduces in a plain C implementation using the same library calls:
#include <stdio.h>
#include <libxml/xmlreader.h>
int main(int argc, char **argv) {
xmlTextReaderPtr reader;
reader = xmlReaderForMemory("<root>\n<child/>\n</root>\n", 23, NULL, NULL, 0);
printf("%s", xmlTextReaderReadOuterXml(reader));
}
Either we're using the libxml2 API wrong (but that shouldn't trigger a segfault) or this is a regression bug.
The only change to xmlTextReaderReadOuterXML
between 2.9.8 and 2.9.9 was this one: 39fbfb4f
Reference to Crystal's issue tracker: https://github.com/crystal-lang/crystal/issues/7476
Edited by Ghost User