[model]
[binary_type] platform
[customer]
[issue#]
[problem] pOldBuffer accesses freed memory.
[cause] Original momory pointer from pOldEncodedData is deleted.
[solution] remove explicit free code of unique_ptr
[team] Base F/W
[request] N/A
[horizontal_expansion] N/A
Change-Id: I7bee97f9592a2a95d68cf55a7bcacbc5aa49314e
Signed-off-by: jc815.lee <jc815.lee@samsung.com>
}
std::unique_ptr< ByteBuffer > pDecodedBuffer(Tizen::Base::Utility::StringUtil::DecodeBase64StringN(encodedStr));
- result r = GetLastResult();
- SysTryReturn(NID_SEC_CERT, r == E_SUCCESS, -1 , E_SYSTEM, "[%s] Failed to DecodeBase64StringN.", GetErrorMessage(r));
SysTryReturn(NID_SEC_CERT, pDecodedBuffer != null, -1, E_SYSTEM, "[E_SYSTEM] Failed to perform base64 decoding.");
if (outSize > pDecodedBuffer->GetRemaining())
oldBufferLen = pOldEncodedData->GetRemaining();
SysTryReturnResult(NID_SEC_CERT, oldBufferLen > 0, E_INVALID_ARG, "Input old certificate length is not positive.");
- pOldEncodedData.reset(null);
+ //pOldEncodedData.reset(null);
std::unique_ptr< ByteBuffer > pNewEncodedData(newCert.GetEncodedDataN());
SysTryReturnResult(NID_SEC_CERT, pNewEncodedData != null, E_INVALID_ARG, "Failed to get encoded data on new input certificate.");