mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 16:54:46 +02:00
Fix silly missing bufsize-- in xmlescape(). Not exploitable.
This XML code is only used for DroneBL submission with no user- controlled variables (except $ip). Still, silly mistake to make and who knows what other XML stuff will happen in the future.
This commit is contained in:
@@ -1376,6 +1376,7 @@ char *xmlescape(const char *i, char *buf, int bufsize)
|
||||
break;
|
||||
strcpy(o, """);
|
||||
o += 6;
|
||||
bufsize -= 6;
|
||||
} else
|
||||
if (*i == '\'')
|
||||
{
|
||||
@@ -1383,6 +1384,7 @@ char *xmlescape(const char *i, char *buf, int bufsize)
|
||||
break;
|
||||
strcpy(o, "'");
|
||||
o += 6;
|
||||
bufsize -= 6;
|
||||
} else
|
||||
if (*i == '<')
|
||||
{
|
||||
@@ -1390,6 +1392,7 @@ char *xmlescape(const char *i, char *buf, int bufsize)
|
||||
break;
|
||||
strcpy(o, "<");
|
||||
o += 4;
|
||||
bufsize -= 4;
|
||||
} else
|
||||
if (*i == '>')
|
||||
{
|
||||
@@ -1397,6 +1400,7 @@ char *xmlescape(const char *i, char *buf, int bufsize)
|
||||
break;
|
||||
strcpy(o, ">");
|
||||
o += 4;
|
||||
bufsize -= 4;
|
||||
} else
|
||||
if (*i == '&')
|
||||
{
|
||||
@@ -1404,11 +1408,13 @@ char *xmlescape(const char *i, char *buf, int bufsize)
|
||||
break;
|
||||
strcpy(o, "&");
|
||||
o += 5;
|
||||
bufsize -= 5;
|
||||
} else
|
||||
{
|
||||
if (bufsize <= 1)
|
||||
break;
|
||||
*o++ = *i;
|
||||
bufsize--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user