diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-05 11:23:23 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-05 11:23:23 +0000 |
commit | 216df844558e0f906c9f50ef0e770bd597e0b407 (patch) | |
tree | e94ac1af8a07e9bd8260fd7d2124c3a1df4f686b /protocols/JabberG/src | |
parent | 24949e548f6e2cdf7f04097686e94dc3cdda34fe (diff) |
Jabber: fix sha-1 hash corruption
git-svn-id: http://svn.miranda-ng.org/main/trunk@16220 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r-- | protocols/JabberG/src/jabber_byte.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index a79b0d6aab..e70684225a 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -372,10 +372,10 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b JabberShaStrBuf buf;
JabberSha1(szAuthString, buf);
- for (i=0; i<40 && buffer[i+5]==buf[i]; i++);
+ for (i = 0; i < 40 && buffer[i + 5] == buf[i]; i++);
memset(data, 0, sizeof(data));
- data[1] = (i>=20)?0:2;
+ data[1] = (i >= 20) ? 0 : 2;
data[0] = 5;
data[3] = 1;
Netlib_Send(hConn, (char*)data, 10, 0);
@@ -386,7 +386,7 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b if (jbt->state == JBT_ERROR)
break;
- if (i>=20 && (this->*jbt->pfnSend)(hConn, jbt->ft)==TRUE)
+ if (i >= 20 && (this->*jbt->pfnSend)(hConn, jbt->ft) == TRUE)
jbt->state = JBT_DONE;
else
jbt->state = JBT_ERROR;
@@ -520,7 +520,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch debugLogA("Auth: '%s'", szAuthString);
JabberShaStrBuf buf;
- strncpy_s((char*)(data + 5), 40, JabberSha1(szAuthString, buf), _TRUNCATE);
+ strncpy_s((char*)(data + 5), 40 + 1, JabberSha1(szAuthString, buf), _TRUNCATE);
Netlib_Send(hConn, (char*)data, 47, 0);
jbt->state = JBT_CONNECT;
@@ -714,7 +714,7 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char debugLogA("Auth: '%s'", szAuthString);
JabberShaStrBuf buf;
- strncpy_s((char*)(data + 5), 40, JabberSha1(szAuthString, buf), _TRUNCATE);
+ strncpy_s((char*)(data + 5), 40 + 1, JabberSha1(szAuthString, buf), _TRUNCATE);
Netlib_Send(hConn, (char*)data, 47, 0);
jbt->state = JBT_CONNECT;
|