diff -r 2f10d260163b -r d07aa956024a crypto/weakcryptospi/source/random/random.cpp --- a/crypto/weakcryptospi/source/random/random.cpp Mon Mar 15 12:46:43 2010 +0200 +++ b/crypto/weakcryptospi/source/random/random.cpp Thu Apr 01 00:24:41 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -56,8 +56,13 @@ void CSystemRandom::GenerateBytesL(TDes8& aDest) { - iShim->GenerateBytesL(aDest); - } + TRAPD(error, iShim->GenerateBytesL(aDest)); + // This method must leave on low memory conditions. + if(error == KErrNoMemory) + { + User::Leave(error); + } + } CSystemRandom::CSystemRandom(void) {