37#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
38#define DICT_RANDOMIZATION
61#define MIN_DICT_SIZE 128
62#define MAX_DICT_HASH 8 * 2048
66#define xmlDictComputeKey(dict, name, len) \
67 (((dict)->size == MIN_DICT_SIZE) ? \
68 xmlDictComputeFastKey(name, len, (dict)->seed) : \
69 xmlDictComputeBigKey(name, len, (dict)->seed))
71#define xmlDictComputeQKey(dict, prefix, plen, name, len) \
72 (((prefix) == NULL) ? \
73 (xmlDictComputeKey(dict, name, len)) : \
74 (((dict)->size == MIN_DICT_SIZE) ? \
75 xmlDictComputeFastQKey(prefix, plen, name, len, (dict)->seed) : \
76 xmlDictComputeBigQKey(prefix, plen, name, len, (dict)->seed)))
79#define xmlDictComputeKey(dict, name, len) \
80 xmlDictComputeFastKey(name, len, (dict)->seed)
81#define xmlDictComputeQKey(dict, prefix, plen, name, len) \
82 xmlDictComputeFastQKey(prefix, plen, name, len, (dict)->seed)
137#ifdef DICT_RANDOMIZATION
142static unsigned int rand_seed = 0;
181#ifdef DICT_RANDOMIZATION
194#ifdef DICT_RANDOMIZATION
203 ret = rand_r(& rand_seed);
250#ifdef DICT_DEBUG_PATTERNS
282#ifdef DICT_DEBUG_PATTERNS
318#ifdef DICT_DEBUG_PATTERNS
350#ifdef DICT_DEBUG_PATTERNS
358 *(
pool->free++) =
':';
424 for (
i = 0;
i < plen;
i++) {
433 for (
i = 0;
i <
len;
i++) {
504 value += 30 * (*prefix);
516 case 10:
value += prefix[9];
518 case 9:
value += prefix[8];
520 case 8:
value += prefix[7];
522 case 7:
value += prefix[6];
524 case 6:
value += prefix[5];
526 case 5:
value += prefix[4];
528 case 4:
value += prefix[3];
530 case 3:
value += prefix[2];
532 case 2:
value += prefix[1];
534 case 1:
value += prefix[0];
584#ifdef DICT_DEBUG_PATTERNS
590 dict->ref_counter = 1;
600#ifdef DICT_RANDOMIZATION
628#ifdef DICT_DEBUG_PATTERNS
670 unsigned long key, okey;
675 unsigned long nbElem = 0;
687#ifdef DICT_DEBUG_PATTERNS
691 oldsize = dict->
size;
692 olddict = dict->
dict;
700 dict->
dict = olddict;
712 for (
i = 0;
i < oldsize;
i++) {
713 if (olddict[
i].
valid == 0)
722 if (dict->
dict[
key].valid == 0) {
750 for (
i = 0;
i < oldsize;
i++) {
751 iter = olddict[
i].
next;
764 if (dict->
dict[
key].valid == 0) {
788 "xmlDictGrow : from %lu to %lu, %u elems\n", oldsize,
size, nbElem);
832 iter = &(dict->
dict[
i]);
833 if (iter->
valid == 0)
868 unsigned long key,
okey, nbi = 0;
891 if (dict->
dict[
key].valid == 0) {
939 if ((tmp->
okey == skey) && (tmp->
len ==
l)) {
944 if ((tmp->
okey == skey) && (tmp->
len ==
l) &&
951 if ((tmp->
okey == skey) && (tmp->
len ==
l)) {
956 if ((tmp->
okey == skey) && (tmp->
len ==
l) &&
1008 unsigned long key,
okey, nbi = 0;
1028 if (dict->
dict[
key].valid == 0) {
1076 if ((tmp->
okey == skey) && (tmp->
len ==
l)) {
1081 if ((tmp->
okey == skey) && (tmp->
len ==
l) &&
1088 if ((tmp->
okey == skey) && (tmp->
len ==
l)) {
1093 if ((tmp->
okey == skey) && (tmp->
len ==
l) &&
1116 unsigned long okey,
key, nbi = 0;
1120 unsigned int len, plen,
l;
1128 plen =
strlen((
const char *) prefix);
1136 if (dict->
dict[
key].valid == 0) {
1168 if ((tmp->
okey == skey) && (tmp->
len ==
len) &&
1173 if ((tmp->
okey == skey) && (tmp->
len ==
len) &&
1227 if ((
str >= &
pool->array[0]) && (str <= pool->
free))
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
void __cdecl srand(_In_ unsigned int _Seed)
_Check_return_ int __cdecl rand(void)
#define ATTRIBUTE_NO_SANITIZE(arg)
#define memcpy(s1, s2, n)
static unsigned __int64 next
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBVAR void * xmlGenericErrorContext
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
static xmlMutexPtr xmlDictMutex
static const xmlChar * xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, unsigned int plen, const xmlChar *name, unsigned int namelen)
static int xmlDictInitialized
void xmlDictFree(xmlDictPtr dict)
static unsigned long xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed)
const xmlChar * xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len)
static uint32_t xmlDictComputeBigKey(const xmlChar *data, int namelen, int seed)
xmlDictPtr xmlDictCreateSub(xmlDictPtr sub)
int xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
xmlDictStrings * xmlDictStringsPtr
size_t xmlDictGetUsage(xmlDictPtr dict)
void xmlDictCleanup(void)
size_t xmlDictSetLimit(xmlDictPtr dict, size_t limit)
int __xmlInitializeDict(void)
int xmlDictReference(xmlDictPtr dict)
#define xmlDictComputeKey(dict, name, len)
const xmlChar * xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name)
#define xmlDictComputeQKey(dict, prefix, plen, name, len)
static unsigned long xmlDictComputeBigQKey(const xmlChar *prefix, int plen, const xmlChar *name, int len, int seed)
int xmlDictSize(xmlDictPtr dict)
static int xmlDictGrow(xmlDictPtr dict, size_t size)
static const xmlChar * xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen)
int xmlInitializeDict(void)
xmlDictPtr xmlDictCreate(void)
const xmlChar * xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
xmlDictEntry * xmlDictEntryPtr
static unsigned long xmlDictComputeFastQKey(const xmlChar *prefix, int plen, const xmlChar *name, int len, int seed)
struct _xmlDictEntry * next
struct _xmlDictEntry * dict
xmlDictStringsPtr strings
struct _xmlDict * subdict
XMLPUBFUN void XMLCALL xmlMutexUnlock(xmlMutexPtr tok)
XMLPUBFUN xmlMutexPtr XMLCALL xmlNewMutex(void)
XMLPUBFUN void XMLCALL xmlFreeMutex(xmlMutexPtr tok)
XMLPUBFUN void XMLCALL xmlMutexLock(xmlMutexPtr tok)
XMLPUBFUN int XMLCALL xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
XMLPUBFUN int XMLCALL xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str)