From bf334028452c8286c70a59a2aaaba23843362b03 Mon Sep 17 00:00:00 2001 From: SoraYuki Date: Mon, 18 Mar 2024 22:00:51 +0800 Subject: [PATCH] fix crash caused memory read overflow. --- src/protocols.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocols.cpp b/src/protocols.cpp index 622b582..4dcf577 100644 --- a/src/protocols.cpp +++ b/src/protocols.cpp @@ -13,7 +13,7 @@ class ProtocolInfosImpl: public ProtocolInfos { public: const ProtocolInfo* GetInfo(const char* protocol) override { std::string_view to_find{ protocol }; - for(auto p = s_infoList; p; ++p) { + for(auto p = s_infoList; p->protocol; ++p) { if (to_find == p->protocol) return p; }