Heap corruption fix.

This commit is contained in:
cora32 2015-01-17 04:06:47 +03:00
parent b9adb70cef
commit ba8d98ee71
2 changed files with 7 additions and 25 deletions

View File

@ -51,26 +51,6 @@ void BConDec()
stt->doEmitionChangeBA(QString::number(BrutingThrds)); stt->doEmitionChangeBA(QString::number(BrutingThrds));
#pragma endregion #pragma endregion
}; };
void SSHConInc()
{
__asm
{
lock inc BrutingThrds;
};
#pragma region QTGUI_Area
stt->doEmitionChangeBA(QString::number(BrutingThrds));
#pragma endregion
};
void SSHConDec()
{
__asm
{
lock dec BrutingThrds;
};
#pragma region QTGUI_Area
stt->doEmitionChangeBA(QString::number(BrutingThrds));
#pragma endregion
};
bool debugWriteWait = false; bool debugWriteWait = false;
void _DebugWriteHTMLToFile(char *request, char *buff) void _DebugWriteHTMLToFile(char *request, char *buff)
{ {
@ -2089,7 +2069,7 @@ int _EstablishSSHConnection(char *host, int port, conSTR *CSTR, char *banner)
char pass[32] = {0}; char pass[32] = {0};
char temp[64] = {0}; char temp[64] = {0};
isActive = 1; isActive = 1;
SSHConInc(); BConInc();
int sz = 0; int sz = 0;
char *ptr1 = 0; char *ptr1 = 0;
int res = -1; int res = -1;
@ -2108,19 +2088,19 @@ int _EstablishSSHConnection(char *host, int port, conSTR *CSTR, char *banner)
if(res == 0) if(res == 0)
{ {
if(i == 0) return -2; //Failhit if(i == 0) return -2; //Failhit
SSHConDec(); BConDec();
isActive = 0; isActive = 0;
return 0; return 0;
} }
else if(res == -2) else if(res == -2)
{ {
SSHConDec(); BConDec();
isActive = 0; isActive = 0;
return -2; return -2;
}; };
Sleep(500); Sleep(500);
}; };
SSHConDec(); BConDec();
isActive = 0; isActive = 0;
return -1; return -1;
}; };

View File

@ -407,10 +407,12 @@ int ContentFilter(char *buff, int port, char *ip, char *cp)
{ {
if(buff != NULL) if(buff != NULL)
{ {
int sz = strlen(buff);
int res = 0; int res = 0;
std::string tempString = toLowerStr(buff);
int sz = tempString.size();
char *lBuff = new char[sz + 1]; char *lBuff = new char[sz + 1];
ZeroMemory(lBuff, sz + 1); ZeroMemory(lBuff, sz + 1);
if(strstr(cp, "1251") != NULL) if(strstr(cp, "1251") != NULL)
{ {
strcpy(lBuff, toLowerStr(buff).c_str()); strcpy(lBuff, toLowerStr(buff).c_str());