mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01: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:
@@ -294,13 +294,13 @@ CString CString::Escape_n(EEscape eFrom, EEscape eTo) const {
|
||||
}
|
||||
|
||||
if (ch == 0) {
|
||||
if (!strncasecmp((const char*)&pTmp, "<", 2))
|
||||
if (!strncasecmp((const char*)&pTmp, "<", 4))
|
||||
ch = '<';
|
||||
else if (!strncasecmp((const char*)&pTmp, ">", 2))
|
||||
else if (!strncasecmp((const char*)&pTmp, ">", 4))
|
||||
ch = '>';
|
||||
else if (!strncasecmp((const char*)&pTmp, """, 4))
|
||||
else if (!strncasecmp((const char*)&pTmp, """, 6))
|
||||
ch = '"';
|
||||
else if (!strncasecmp((const char*)&pTmp, "&", 3))
|
||||
else if (!strncasecmp((const char*)&pTmp, "&", 5))
|
||||
ch = '&';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user