mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-24 21:33:51 +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
12
xmllint.c
12
xmllint.c
@ -672,10 +672,13 @@ xmlHTMLValidityError(void *ctx, const char *msg, ...)
|
||||
|
||||
buffer[0] = 0;
|
||||
input = ctxt->input;
|
||||
if ((input->filename == NULL) && (ctxt->inputNr > 1))
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
|
||||
xmlHTMLPrintFileInfo(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,7 +688,8 @@ xmlHTMLValidityError(void *ctx, const char *msg, ...)
|
||||
xmlHTMLEncodeSend();
|
||||
fprintf(ERR_STREAM, "</p>\n");
|
||||
|
||||
xmlHTMLPrintFileContext(input);
|
||||
if (input != NULL)
|
||||
xmlHTMLPrintFileContext(input);
|
||||
xmlHTMLEncodeSend();
|
||||
progresult = XMLLINT_ERR_VALID;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user