diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-20 21:28:27 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-20 21:28:27 +0000 |
commit | 71465258cce14f8d417ba31e3010298f7640ac2d (patch) | |
tree | 1fe57d014d8ae844000412429235a0c4297a41dc /protocols/JabberG/src/jabber_iqid.cpp | |
parent | 5756772ef9e9fd5b4a730d8a16737996cbec55f5 (diff) |
- built-in base64 encode removed;
- various memory allocation issues
git-svn-id: http://svn.miranda-ng.org/main/trunk@5435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_iqid.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_iqid.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 6bd2a40761..b45bdfe821 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -614,11 +614,12 @@ void CJabberProto::OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, HANDLE hCon return;
HXML o = xmlGetChild(n, "BINVAL");
- if (o == NULL || xmlGetText(o) == NULL)
+ LPCTSTR ptszBinval = xmlGetText(o);
+ if (o == NULL || ptszBinval == NULL)
return;
- int bufferLen;
- ptrA buffer( JabberBase64DecodeT(xmlGetText(o), &bufferLen));
+ unsigned bufferLen;
+ ptrA buffer((char*)mir_base64_decode( _T2A(ptszBinval), &bufferLen));
if (buffer == NULL)
return;
@@ -1442,8 +1443,8 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode) void CJabberProto::OnIqResultGotAvatar(HANDLE hContact, HXML n, const TCHAR *mimeType)
{
- int resultLen = 0;
- ptrA body( JabberBase64DecodeT( xmlGetText(n), &resultLen));
+ unsigned resultLen;
+ ptrA body((char*)mir_base64_decode( _T2A(xmlGetText(n)), &resultLen));
int pictureType;
if (mimeType != NULL) {
@@ -1454,7 +1455,6 @@ void CJabberProto::OnIqResultGotAvatar(HANDLE hContact, HXML n, const TCHAR *mim else {
LBL_ErrFormat:
Log("Invalid mime type specified for picture: %S", mimeType);
- mir_free(body);
return;
} }
else if ((pictureType = JabberGetPictureType(body)) == PA_FORMAT_UNKNOWN)
|