Fix invalid bufSize().
bufUsed() should be used here to avoid a possible segfault or xml parse error when bufSize() > bufUsed().
@@ -475,7 +475,7 @@ xmlDocumentNewBuf(const Buffer *buffer)
ASSERT(buffer != NULL);
ASSERT(bufSize(buffer) > 0);
- FUNCTION_TEST_RETURN(xmlDocumentNewC(bufPtr(buffer), bufSize(buffer)));
+ FUNCTION_TEST_RETURN(xmlDocumentNewC(bufPtr(buffer), bufUsed(buffer)));
}
/***********************************************************************************************************************************
