mirror of
https://gitea.psi.ch/ELOG/mxml.git
synced 2026-09-09 01:23:22 +00:00
Fixed endless loop in mxml_decode if a comment contained an entity like &XYZ;
This commit is contained in:
parent
dabfe6db7c
commit
fdfe3d2413
11
mxml.c
11
mxml.c
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user