some fixes

This commit is contained in:
meneleos
2025-09-26 22:03:13 +03:00
parent fff90d6c6c
commit 173c6828a8
5 changed files with 36 additions and 7 deletions

View File

@@ -510,6 +510,7 @@ void CClientManager::RESULT_SAFEBOX_LOAD(CPeer * pkPeer, SQLMsg * msg)
if (strcmp("000000", szSafeboxPassword))
{
pkPeer->EncodeHeader(HEADER_DG_SAFEBOX_WRONG_PASSWORD, dwHandle, 0);
delete pSafebox;
delete pi;
return;
}
@@ -523,6 +524,7 @@ void CClientManager::RESULT_SAFEBOX_LOAD(CPeer * pkPeer, SQLMsg * msg)
((row[2] && *row[2]) && strcmp(row[2], szSafeboxPassword)))
{
pkPeer->EncodeHeader(HEADER_DG_SAFEBOX_WRONG_PASSWORD, dwHandle, 0);
delete pSafebox;
delete pi;
return;
}
@@ -859,7 +861,7 @@ void CClientManager::RESULT_SAFEBOX_CHANGE_PASSWORD(CPeer * pkPeer, SQLMsg * msg
{
MYSQL_ROW row = mysql_fetch_row(msg->Get()->pSQLResult);
if (row[0] && *row[0] && !strcasecmp(row[0], p->login) || (!row[0] || !*row[0]) && !strcmp("000000", p->login))
if ((row[0] && *row[0] && !strcasecmp(row[0], p->login)) || ((!row[0] || !*row[0]) && !strcmp("000000", p->login)))
{
char szQuery[QUERY_MAX_LEN];
char escape_pwd[64];
@@ -907,6 +909,9 @@ void CClientManager::RESULT_PRICELIST_LOAD(CPeer* peer, SQLMsg* pMsg)
while ((row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
{
if (table.byCount >= SHOP_PRICELIST_MAX_NUM)
break;
str_to_number(table.aPriceInfo[table.byCount].dwVnum, row[0]);
str_to_number(table.aPriceInfo[table.byCount].dwPrice, row[1]);
table.byCount++;
@@ -950,6 +955,9 @@ void CClientManager::RESULT_PRICELIST_LOAD_FOR_UPDATE(SQLMsg* pMsg)
while ((row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
{
if (table.byCount >= SHOP_PRICELIST_MAX_NUM)
break;
str_to_number(table.aPriceInfo[table.byCount].dwVnum, row[0]);
str_to_number(table.aPriceInfo[table.byCount].dwPrice, row[1]);
table.byCount++;
@@ -1991,7 +1999,7 @@ void CClientManager::WeddingEnd(TPacketWeddingEnd * p)
// Fixed code:
void CClientManager::MyshopPricelistUpdate(const TItemPriceListTable* pPacket)
{
if (pPacket->byCount > SHOP_PRICELIST_MAX_NUM)
if (pPacket->byCount >= SHOP_PRICELIST_MAX_NUM)
{
sys_err("count overflow!");
return;