@@ -510,6 +510,7 @@ void CClientManager::RESULT_SAFEBOX_LOAD(CPeer * pkPeer, SQLMsg * msg)
510510 if (strcmp (" 000000" , szSafeboxPassword))
511511 {
512512 pkPeer->EncodeHeader (HEADER_DG_SAFEBOX_WRONG_PASSWORD , dwHandle, 0 );
513+ delete pSafebox;
513514 delete pi;
514515 return ;
515516 }
@@ -523,6 +524,7 @@ void CClientManager::RESULT_SAFEBOX_LOAD(CPeer * pkPeer, SQLMsg * msg)
523524 ((row[2 ] && *row[2 ]) && strcmp (row[2 ], szSafeboxPassword)))
524525 {
525526 pkPeer->EncodeHeader (HEADER_DG_SAFEBOX_WRONG_PASSWORD , dwHandle, 0 );
527+ delete pSafebox;
526528 delete pi;
527529 return ;
528530 }
@@ -859,7 +861,7 @@ void CClientManager::RESULT_SAFEBOX_CHANGE_PASSWORD(CPeer * pkPeer, SQLMsg * msg
859861 {
860862 MYSQL_ROW row = mysql_fetch_row (msg->Get ()->pSQLResult );
861863
862- if (row[0 ] && *row[0 ] && !strcasecmp (row[0 ], p->login ) || (!row[0 ] || !*row[0 ]) && !strcmp (" 000000" , p->login ))
864+ if (( row[0 ] && *row[0 ] && !strcasecmp (row[0 ], p->login )) || (( !row[0 ] || !*row[0 ]) && !strcmp (" 000000" , p->login ) ))
863865 {
864866 char szQuery[QUERY_MAX_LEN ];
865867 char escape_pwd[64 ];
@@ -907,6 +909,9 @@ void CClientManager::RESULT_PRICELIST_LOAD(CPeer* peer, SQLMsg* pMsg)
907909
908910 while ((row = mysql_fetch_row (pMsg->Get ()->pSQLResult )))
909911 {
912+ if (table.byCount >= SHOP_PRICELIST_MAX_NUM )
913+ break ;
914+
910915 str_to_number (table.aPriceInfo [table.byCount ].dwVnum , row[0 ]);
911916 str_to_number (table.aPriceInfo [table.byCount ].dwPrice , row[1 ]);
912917 table.byCount ++;
@@ -950,6 +955,9 @@ void CClientManager::RESULT_PRICELIST_LOAD_FOR_UPDATE(SQLMsg* pMsg)
950955
951956 while ((row = mysql_fetch_row (pMsg->Get ()->pSQLResult )))
952957 {
958+ if (table.byCount >= SHOP_PRICELIST_MAX_NUM )
959+ break ;
960+
953961 str_to_number (table.aPriceInfo [table.byCount ].dwVnum , row[0 ]);
954962 str_to_number (table.aPriceInfo [table.byCount ].dwPrice , row[1 ]);
955963 table.byCount ++;
@@ -1991,7 +1999,7 @@ void CClientManager::WeddingEnd(TPacketWeddingEnd * p)
19911999// Fixed code:
19922000void CClientManager::MyshopPricelistUpdate (const TItemPriceListTable* pPacket)
19932001{
1994- if (pPacket->byCount > SHOP_PRICELIST_MAX_NUM )
2002+ if (pPacket->byCount >= SHOP_PRICELIST_MAX_NUM )
19952003 {
19962004 sys_err (" count overflow!" );
19972005 return ;
0 commit comments