- Apply @geoffmcl's patches and tested.
This commit is contained in:
Jim Derry 2017-09-29 15:42:03 -04:00
parent d6c974b672
commit 2852ad4c63
2 changed files with 9 additions and 6 deletions

View file

@ -1517,15 +1517,16 @@ static void CheckLowerCaseAttrValue( TidyDocImpl* doc, Node *node, AttVal *attva
} }
} }
/* methods for checking value of a specific attribute */ /* Issue #588 - use simple macros only!
#ifdef _WIN32 Seems 'isalnum(c)' is undefined and can
cause an assert or a SIGSEGV in some libraries
if 'c' is not EOF, or in the range 0 to 0xff,
so avoid using it.
*/
#define ISUPPER(a) ((a >= 'A') && (a <= 'Z')) #define ISUPPER(a) ((a >= 'A') && (a <= 'Z'))
#define ISLOWER(a) ((a >= 'a') && (a <= 'z')) #define ISLOWER(a) ((a >= 'a') && (a <= 'z'))
#define ISNUMERIC(a) ((a >= '0') && (a <= '9')) #define ISNUMERIC(a) ((a >= '0') && (a <= '9'))
#define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a)) #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
#else
#define ISALNUM(a) isalnum(a)
#endif
static Bool IsURLCodePoint( ctmbstr p, uint *increment ) static Bool IsURLCodePoint( ctmbstr p, uint *increment )
{ {

View file

@ -1902,7 +1902,9 @@ void TY_(CleanWord2000)( TidyDocImpl* doc, Node *node)
attval = node->attributes; attval = node->attributes;
while ( attval ) { while ( attval ) {
next_attr = attval->next; next_attr = attval->next;
if ( strcmp(attval->attribute, "xmlns") != 0 )
/* Issue #591 - take care of a NULL attribute, too. */
if ( !attval->attribute || ( strcmp(attval->attribute, "xmlns") != 0 ))
TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE); TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE);
attval = next_attr; attval = next_attr;
} }