1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

Revert "SAX1: Align handling of default attributes with SAX2"

This reverts commit db65b2fc51.

This didn't check for duplicate default attributes.
This commit is contained in:
Nick Wellnhofer
2025-06-03 16:12:56 +02:00
parent 30375877d9
commit 2b6b3945f2
3 changed files with 169 additions and 82 deletions

View File

@@ -4,8 +4,6 @@
#include <libxml/parser.h>
#include <libxml/xmlversion.h>
#include "private/dict.h"
#define XML_INVALID_CHAR 0x200000
#define XML_MAX_URI_LENGTH 2000
@@ -58,35 +56,13 @@
*/
#define INPUT_CHUNK 250
#define XML_SCAN_NC 1
#define XML_SCAN_NMTOKEN 2
#define XML_SCAN_OLD10 4
struct _xmlAttrHashBucket {
int index;
};
typedef struct {
xmlHashedString prefix;
xmlHashedString name;
xmlHashedString value;
const xmlChar *valueEnd;
int external;
int expandedSize;
} xmlDefAttr;
typedef struct _xmlDefAttrs xmlDefAttrs;
typedef xmlDefAttrs *xmlDefAttrsPtr;
struct _xmlDefAttrs {
int nbAttrs; /* number of defaulted attributes on that element */
int maxAttrs; /* the size of the array */
#if __STDC_VERSION__ >= 199901L
/* Using a C99 flexible array member avoids UBSan errors. */
xmlDefAttr attrs[] ATTRIBUTE_COUNTED_BY(maxAttrs);
#else
xmlDefAttr attrs[1];
#endif
};
#define XML_SCAN_NC 1
#define XML_SCAN_NMTOKEN 2
#define XML_SCAN_OLD10 4
XML_HIDDEN const xmlChar *
xmlScanName(const xmlChar *buf, size_t maxSize, int flags);