mpserviceplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp
changeset 47 4cc1412daed0
parent 45 612c4815aebe
child 51 560ce2306a17
equal deleted inserted replaced
45:612c4815aebe 47:4cc1412daed0
   601     const TDesC& aString)
   601     const TDesC& aString)
   602     {
   602     {
   603     MPX_FUNC("MPXDbCommonUtil::ProcessSingleQuotesLC");
   603     MPX_FUNC("MPXDbCommonUtil::ProcessSingleQuotesLC");
   604 
   604 
   605     // reserve space for all single quotes (double the size)
   605     // reserve space for all single quotes (double the size)
       
   606     // coverity[incorrect_multiplication]
       
   607     // coverity[buffer_alloc]
   606     HBufC* value = HBufC::NewLC(aString.Length() * 2);
   608     HBufC* value = HBufC::NewLC(aString.Length() * 2);
   607     TPtr valuePtr(value->Des());
   609     TPtr valuePtr(value->Des());
   608 
   610 
   609     MPXDbCommonUtil::FindAndReplaceSingleQuote(aString, valuePtr);
   611     MPXDbCommonUtil::FindAndReplaceSingleQuote(aString, valuePtr);
   610 
   612 
   627     MPX_FUNC("MPXDbCommonUtil::ProcessPatternCharsLC");
   629     MPX_FUNC("MPXDbCommonUtil::ProcessPatternCharsLC");
   628 
   630 
   629     // reserve space for all percentage signs (triple the size because % should
   631     // reserve space for all percentage signs (triple the size because % should
   630     // be replaced by %%)
   632     // be replaced by %%)
   631     TInt srcLen(aString.Length());
   633     TInt srcLen(aString.Length());
       
   634     // coverity[incorrect_multiplication]
       
   635     // coverity[buffer_alloc]
   632     HBufC* targetString = HBufC::NewLC(aString.Length() * 3);
   636     HBufC* targetString = HBufC::NewLC(aString.Length() * 3);
   633     TPtr targetStringPtr(targetString->Des());
   637     TPtr targetStringPtr(targetString->Des());
   634 
   638 
   635     TPtrC ch;
   639     TPtrC ch;
   636     for (TInt i = 0; i < srcLen; ++i)
   640     for (TInt i = 0; i < srcLen; ++i)