[LIBXML2] Update to version 2.9.12. CORE-17766

This commit is contained in:
Thomas Faber 2021-09-12 13:24:24 -04:00
parent 271556e6f8
commit 40ee59d609
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
60 changed files with 3385 additions and 2832 deletions

View file

@ -130,16 +130,18 @@ xmlCharStrdup(const char *cur) {
int
xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
register int tmp;
if (str1 == str2) return(0);
if (str1 == NULL) return(-1);
if (str2 == NULL) return(1);
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
return(strcmp((const char *)str1, (const char *)str2));
#else
do {
tmp = *str1++ - *str2;
int tmp = *str1++ - *str2;
if (tmp != 0) return(tmp);
} while (*str2++ != 0);
return 0;
#endif
}
/**
@ -158,10 +160,14 @@ xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
if (str1 == str2) return(1);
if (str1 == NULL) return(0);
if (str2 == NULL) return(0);
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
return(strcmp((const char *)str1, (const char *)str2) == 0);
#else
do {
if (*str1++ != *str2) return(0);
} while (*str2++);
return(1);
#endif
}
/**
@ -204,18 +210,15 @@ xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
int
xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
register int tmp;
if (len <= 0) return(0);
if (str1 == str2) return(0);
if (str1 == NULL) return(-1);
if (str2 == NULL) return(1);
#ifdef __GNUC__
tmp = strncmp((const char *)str1, (const char *)str2, len);
return tmp;
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
return(strncmp((const char *)str1, (const char *)str2, len));
#else
do {
tmp = *str1++ - *str2;
int tmp = *str1++ - *str2;
if (tmp != 0 || --len == 0) return(tmp);
} while (*str2++ != 0);
return 0;