summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_captcha.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-20 21:28:27 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-20 21:28:27 +0000
commit71465258cce14f8d417ba31e3010298f7640ac2d (patch)
tree1fe57d014d8ae844000412429235a0c4297a41dc /protocols/JabberG/src/jabber_captcha.cpp
parent5756772ef9e9fd5b4a730d8a16737996cbec55f5 (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_captcha.cpp')
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index dcb9d8c3b6..ce4018ca66 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -111,9 +111,6 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData* info)
{
- CAPTCHA_FORM_PARAMS param;
- TCHAR *CaptchaPath = 0;
-
HXML x = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (x == NULL)
return false;
@@ -123,6 +120,8 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData* info)
return false;
if ((y = xmlGetChild(y, "value")) == NULL)
return false;
+
+ CAPTCHA_FORM_PARAMS param;
param.fromjid = xmlGetText(y);
if ((y = xmlGetChildByTag(x, _T("field"), _T("var"), _T("sid"))) == NULL)
@@ -142,6 +141,7 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData* info)
if (o == NULL || xmlGetText(o) == NULL)
return false;
+ TCHAR *CaptchaPath = 0;
GetCaptchaImage(parentNode, CaptchaPath);
param.bmp = (HBITMAP) CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)CaptchaPath);
DeleteFile(CaptchaPath);
@@ -162,8 +162,8 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData* info)
bool CJabberProto::GetCaptchaImage(HXML node, TCHAR*& CaptchaPath)
{
HXML o = xmlGetChild(node , "data");
- int bufferLen;
- char* buffer = JabberBase64DecodeT(xmlGetText(o), &bufferLen);
+ unsigned bufferLen;
+ ptrA buffer((char*)mir_base64_decode( _T2A(xmlGetText(o)), &bufferLen));
if (buffer == NULL)
return false;