reader: Add argument checks

This commit is contained in:
Nick Wellnhofer 2024-12-12 22:09:25 +01:00
parent 49164610a4
commit e6045ed754

View File

@ -5009,6 +5009,8 @@ xmlTextReaderSetup(xmlTextReaderPtr reader,
void
xmlTextReaderSetMaxAmplification(xmlTextReaderPtr reader, unsigned maxAmpl)
{
if (reader == NULL)
return;
xmlCtxtSetMaxAmplification(reader->ctxt, maxAmpl);
}
@ -5023,7 +5025,7 @@ xmlTextReaderSetMaxAmplification(xmlTextReaderPtr reader, unsigned maxAmpl)
const xmlError *
xmlTextReaderGetLastError(xmlTextReaderPtr reader)
{
if (reader == NULL)
if ((reader == NULL) || (reader->ctxt == NULL))
return(NULL);
return(&reader->ctxt->lastError);
}