1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 18:55:29 +03:00
aports/testing/kopano-core/0002-provider.patch
Noel Kuntze e87dd48b4d testing/kopano-core: new aport
Open Source Groupware Solution
2021-07-25 07:45:25 +00:00

20 lines
909 B
Diff

diff --git a/provider/client/WSUtil.cpp b/provider/client/WSUtil.cpp
index 2bfa558ec..64d99fa9f 100644
--- a/provider/client/WSUtil.cpp
+++ b/provider/client/WSUtil.cpp
@@ -2077,7 +2077,14 @@ static HRESULT CopyMAPISourceKeyToSoapSourceKey(const SBinary *lpsMAPISourceKey,
{
if (lpsMAPISourceKey == nullptr || lpsSoapSourceKey == nullptr)
return MAPI_E_INVALID_PARAMETER;
- lpsSoapSourceKey->__ptr = soap_new_unsignedByte(nullptr, lpsSoapSourceKey->__size);
+ if (lpsMAPISourceKey->lpb == nullptr) {
+ lpsSoapSourceKey->__ptr = nullptr;
+ lpsSoapSourceKey->__size = 0;
+ return hrSuccess;
+ }
+ lpsSoapSourceKey->__ptr = soap_new_unsignedByte(nullptr, lpsMAPISourceKey->cb);
+ if (lpsSoapSourceKey->__ptr == nullptr)
+ throw std::bad_alloc();
lpsSoapSourceKey->__size = lpsMAPISourceKey->cb;
memcpy(lpsSoapSourceKey->__ptr, lpsMAPISourceKey->lpb, lpsSoapSourceKey->__size);
return hrSuccess;