From 0eb1658ca7501ca919e5f23f788d75245b6aee77 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 29 May 2015 16:35:44 +0200 Subject: [PATCH] wxOSX: don't call strlen() on possibly null pointer. Use wxCharBuffer::length() instead, this is more efficient and safer as it correctly returns 0 in case the conversion fails. Closes #9967. --- src/osx/utils_osx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osx/utils_osx.cpp b/src/osx/utils_osx.cpp index bfcf65f57c..d356a5c953 100644 --- a/src/osx/utils_osx.cpp +++ b/src/osx/utils_osx.cpp @@ -274,7 +274,7 @@ CGColorRef wxMacCreateCGColorFromHITheme( ThemeBrush brush ) void wxMacStringToPascal( const wxString&from , unsigned char * to ) { wxCharBuffer buf = from.mb_str( wxConvLocal ); - int len = strlen(buf); + size_t len = buf.length(); if ( len > 255 ) len = 255;