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:
1 parent
972e9adb29
commit
0e2ea2fa6c
1 file changed
+4
-4
+4
-4
@@ -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