From 05fd715a1202b01bb28b783b418b9421ad30f0c7 Mon Sep 17 00:00:00 2001 From: James Clark Date: Sat, 23 May 1998 07:27:59 +0000 Subject: [PATCH] Require whitespace between attribute name and following attribute value --- expat/xmltok/xmltok_impl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/expat/xmltok/xmltok_impl.c b/expat/xmltok/xmltok_impl.c index cc64e959..4f838325 100755 --- a/expat/xmltok/xmltok_impl.c +++ b/expat/xmltok/xmltok_impl.c @@ -606,6 +606,22 @@ int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, break; } } + ptr += MINBPC; + if (ptr == end) + return XML_TOK_PARTIAL; + switch (BYTE_TYPE(enc, ptr)) { + case BT_S: + case BT_CR: + case BT_LF: + break; + case BT_SOL: + goto sol; + case BT_GT: + goto gt; + default: + *nextTokPtr = ptr; + return XML_TOK_INVALID; + } /* ptr points to closing quote */ for (;;) { ptr += MINBPC; @@ -616,9 +632,11 @@ int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, case BT_S: case BT_CR: case BT_LF: continue; case BT_GT: + gt: *nextTokPtr = ptr + MINBPC; return XML_TOK_START_TAG_WITH_ATTS; case BT_SOL: + sol: ptr += MINBPC; if (ptr == end) return XML_TOK_PARTIAL; -- 2.40.0