mirror of
https://github.com/znc/znc.git
synced 2026-07-13 13:21:33 +02:00
Fix incorrect html entities parsing in ZNCString.cpp
This PR fixes wrong size argument passed to `strncasecmp` function when it was invoked to check if the string contains HTML entities.
This commit is contained in:
+4
-4
@@ -294,13 +294,13 @@ CString CString::Escape_n(EEscape eFrom, EEscape eTo) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ch == 0) {
|
if (ch == 0) {
|
||||||
if (!strncasecmp((const char*)&pTmp, "<", 2))
|
if (!strncasecmp((const char*)&pTmp, "<", 4))
|
||||||
ch = '<';
|
ch = '<';
|
||||||
else if (!strncasecmp((const char*)&pTmp, ">", 2))
|
else if (!strncasecmp((const char*)&pTmp, ">", 4))
|
||||||
ch = '>';
|
ch = '>';
|
||||||
else if (!strncasecmp((const char*)&pTmp, """, 4))
|
else if (!strncasecmp((const char*)&pTmp, """, 6))
|
||||||
ch = '"';
|
ch = '"';
|
||||||
else if (!strncasecmp((const char*)&pTmp, "&", 3))
|
else if (!strncasecmp((const char*)&pTmp, "&", 5))
|
||||||
ch = '&';
|
ch = '&';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user