From 880077d94c6d42b93c30499fd8a67759662dbfd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Ho=C5=A1ek?= Date: Tue, 7 May 2013 16:47:06 +0200 Subject: [PATCH] HLLib: don't infinite-loop in WStringToString if an unexpected character is detected --- HLLib/Utility.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HLLib/Utility.cpp b/HLLib/Utility.cpp index ad1d85e..0492375 100644 --- a/HLLib/Utility.cpp +++ b/HLLib/Utility.cpp @@ -206,6 +206,10 @@ hlUInt HLLib::WStringToString(const hlWChar *lpSource, hlChar* lpDest, hlUInt ui uiDestSize--; uiCharsWritten++; } + else + { + return 0; + } } if(uiDestSize > 0) {