mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-25 23:21:26 +03:00
xmllint: Check for NULL input in xmlHTMLValidityError
`ctxt->input` can be NULL after commit 61b4c42f
.
This commit is contained in:
parent
ef6e6012e2
commit
3afaff7e8e
@ -672,10 +672,13 @@ xmlHTMLValidityError(void *ctx, const char *msg, ...)
|
||||
|
||||
buffer[0] = 0;
|
||||
input = ctxt->input;
|
||||
|
||||
if (input != NULL) {
|
||||
if ((input->filename == NULL) && (ctxt->inputNr > 1))
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
|
||||
xmlHTMLPrintFileInfo(input);
|
||||
}
|
||||
|
||||
fprintf(ERR_STREAM, "<b>validity error</b>: ");
|
||||
len = strlen(buffer);
|
||||
@ -685,6 +688,7 @@ xmlHTMLValidityError(void *ctx, const char *msg, ...)
|
||||
xmlHTMLEncodeSend();
|
||||
fprintf(ERR_STREAM, "</p>\n");
|
||||
|
||||
if (input != NULL)
|
||||
xmlHTMLPrintFileContext(input);
|
||||
xmlHTMLEncodeSend();
|
||||
progresult = XMLLINT_ERR_VALID;
|
||||
|
Loading…
Reference in New Issue
Block a user