mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
autogenerate a minimal NULL value sequence for unknown pointer types This
* gentest.py testapi.c: autogenerate a minimal NULL value sequence for unknown pointer types * HTMLparser.c SAX2.c chvalid.c encoding.c entities.c parser.c parserInternals.c relaxng.c valid.c xmlIO.c xmlreader.c xmlsave.c xmlschemas.c xmlschemastypes.c xmlstring.c xpath.c xpointer.c: This uncovered an impressive amount of entry points not checking for NULL pointers when they ought to, closing all the open gaps. Daniel
This commit is contained in:
@@ -1794,6 +1794,7 @@ UTF8ToHtml(unsigned char* out, int *outlen,
|
||||
unsigned int c, d;
|
||||
int trailing;
|
||||
|
||||
if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
|
||||
if (in == NULL) {
|
||||
/*
|
||||
* initialization nothing to do
|
||||
@@ -1888,13 +1889,17 @@ int
|
||||
htmlEncodeEntities(unsigned char* out, int *outlen,
|
||||
const unsigned char* in, int *inlen, int quoteChar) {
|
||||
const unsigned char* processed = in;
|
||||
const unsigned char* outend = out + (*outlen);
|
||||
const unsigned char* outend;
|
||||
const unsigned char* outstart = out;
|
||||
const unsigned char* instart = in;
|
||||
const unsigned char* inend = in + (*inlen);
|
||||
const unsigned char* inend;
|
||||
unsigned int c, d;
|
||||
int trailing;
|
||||
|
||||
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL))
|
||||
return(-1);
|
||||
outend = out + (*outlen);
|
||||
inend = in + (*inlen);
|
||||
while (in < inend) {
|
||||
d = *in++;
|
||||
if (d < 0x80) { c= d; trailing= 0; }
|
||||
|
Reference in New Issue
Block a user