From 13ab552e4d5a6fbc443825eadba12d81f2b3f5be Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 11 Feb 2007 02:22:09 +0000 Subject: [PATCH] don't use strlen() to verify the length of the string as it can contain embedded NULs (patch 1643843; closes bug 1642284) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44452 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wxchar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index 52fc61910b..cf4e0a5be5 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -1199,7 +1199,11 @@ int WXDLLEXPORT wxVsnprintf_(wxChar *buf, size_t lenMax, return lenMax+1; // not enough space in the output buffer ! } - wxASSERT(lenCur == wxStrlen(buf)); + // Don't do: + // wxASSERT(lenCur == wxStrlen(buf)); + // in fact if we embedded NULLs in the output buffer (using %c with a '\0') + // such check would fail + return lenCur; }