From ee0536f964edae51c37e80097122e390bdd93f95 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 9f449c9b22..5e36214390 100644 --- a/src/osx/utils_osx.cpp +++ b/src/osx/utils_osx.cpp @@ -264,7 +264,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;