mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-31 06:50:06 +03:00
parser: Use size_t when subtracting input buffer pointers
Avoid integer overflows.
This commit is contained in:
parent
9a6ca81612
commit
b75976e029
@ -3875,7 +3875,7 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) {
|
||||
(ctxt->input->buf->raw != NULL) &&
|
||||
(ctxt->input->buf->buffer != NULL)) {
|
||||
int nbchars;
|
||||
int processed;
|
||||
size_t processed;
|
||||
|
||||
/*
|
||||
* convert as much as possible to the parser reading buffer.
|
||||
|
5
parser.c
5
parser.c
@ -9350,7 +9350,7 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
|
||||
int maxatts = ctxt->maxatts;
|
||||
int nratts, nbatts, nbdef, inputid;
|
||||
int i, j, nbNs, attval;
|
||||
unsigned long cur;
|
||||
size_t cur;
|
||||
int nsNr = ctxt->nsNr;
|
||||
|
||||
if (RAW != '<') return(NULL);
|
||||
@ -11422,7 +11422,8 @@ xmlCheckCdataPush(const xmlChar *utf, int len, int complete) {
|
||||
static int
|
||||
xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
|
||||
int ret = 0;
|
||||
int avail, tlen;
|
||||
int tlen;
|
||||
size_t avail;
|
||||
xmlChar cur, next;
|
||||
|
||||
if (ctxt->input == NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user