mirror of
https://github.com/znc/znc.git
synced 2026-08-12 03:42:48 +02:00
Rewrite message parsing using string_view
It's a bit too early yet to require C++17 so the implementation from BackportCpp (string_view-standalone) is used instead. Fixes https://crbug.com/oss-fuzz/34413 - slow message parsing on huge messages. In real word, messages can't be that big, because CSocket enforces a line length limit. This can be considered a regression of 1.7.0, because before it, instead of gathering params into a vector, code was searching 1st word in the string, then 2nd word, then 3rd word, starting from beginning each time. It was not very efficient, but the number of passes over the string was limited.
This commit is contained in:
@@ -161,7 +161,7 @@ class CMessage {
|
||||
};
|
||||
|
||||
CString ToString(unsigned int uFlags = IncludeAll) const;
|
||||
void Parse(CString sMessage);
|
||||
void Parse(const CString& sMessage);
|
||||
|
||||
// Implicit and explicit conversion to a subclass reference.
|
||||
#ifndef SWIG
|
||||
|
||||
Reference in New Issue
Block a user