From 4496957d9f48e1fb618e01112fee08e7a95739f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= Date: Fri, 10 Apr 2009 21:15:18 +0300 Subject: [PATCH] Avoid alloca() By the way, alloca() _cannot_ return NULL. It simply crashes if there is not enough memory. --- projects/activex/persiststreaminit.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/projects/activex/persiststreaminit.cpp b/projects/activex/persiststreaminit.cpp index 0660566fca..2ec4adb7e7 100644 --- a/projects/activex/persiststreaminit.cpp +++ b/projects/activex/persiststreaminit.cpp @@ -417,9 +417,7 @@ private: if( 0 == len ) return E_INVALIDARG; - LPWSTR propName = (LPOLESTR)::alloca((len+1)*sizeof(WCHAR)); - if( NULL == propName ) - return E_OUTOFMEMORY; + WCHAR propName[len + 1]; result = pStm->Read(propName, len*sizeof(WCHAR), NULL); if( FAILED(result) )