Fixed endless loop in mxml_decode if a comment contained an entity like &XYZ;
This commit is contained in:
@@ -286,22 +286,25 @@ void mxml_decode(char *str)
|
||||
*(p++) = '<';
|
||||
strcpy(p, p+3);
|
||||
}
|
||||
if (strncmp(p, ">", 4) == 0) {
|
||||
else if (strncmp(p, ">", 4) == 0) {
|
||||
*(p++) = '>';
|
||||
strcpy(p, p+3);
|
||||
}
|
||||
if (strncmp(p, "&", 5) == 0) {
|
||||
else if (strncmp(p, "&", 5) == 0) {
|
||||
*(p++) = '&';
|
||||
strcpy(p, p+4);
|
||||
}
|
||||
if (strncmp(p, """, 6) == 0) {
|
||||
else if (strncmp(p, """, 6) == 0) {
|
||||
*(p++) = '\"';
|
||||
strcpy(p, p+5);
|
||||
}
|
||||
if (strncmp(p, "'", 6) == 0) {
|
||||
else if (strncmp(p, "'", 6) == 0) {
|
||||
*(p++) = '\'';
|
||||
strcpy(p, p+5);
|
||||
}
|
||||
else {
|
||||
p++; // skip unknown entity
|
||||
}
|
||||
}
|
||||
/* if (str[0] == '\"' && str[strlen(str)-1] == '\"') {
|
||||
strcpy(str, str+1);
|
||||
|
||||
Reference in New Issue
Block a user