summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-16 20:45:05 +0000
committerLupus <Lupus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-16 20:45:05 +0000
commitde9953f09ca1be9c28b7b5d1ed313ebc50014ad6 (patch)
treef6be7cc3a88efbb819de2836bbc125651a0f171f
parent3beaa56293a5ffcdaa31448c1a13fedbde46ba36 (diff)
downloadhercules-de9953f09ca1be9c28b7b5d1ed313ebc50014ad6.tar.gz
hercules-de9953f09ca1be9c28b7b5d1ed313ebc50014ad6.tar.bz2
hercules-de9953f09ca1be9c28b7b5d1ed313ebc50014ad6.tar.xz
hercules-de9953f09ca1be9c28b7b5d1ed313ebc50014ad6.zip
fixed hack/spoof
STORAGE+TRADE windows duper (with packets snpooffing) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1239 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-SVN.txt4
-rw-r--r--src/map/trade.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt
index 53923722a..d2db0e50a 100644
--- a/Changelog-SVN.txt
+++ b/Changelog-SVN.txt
@@ -1,5 +1,9 @@
Date Added
+03/17
+ * trade.c fixed possibility of STORAGE+TRADE spooffing dupe [Lupus]
+ Now, on accepting trade your active Storage window closes. (Either Common or Guils Storage)
+ thanx to Sergey for the exploit test and report
03/16
* map.c fixed compilation error [Lupus]
* Updated jA's dummy socket to mod1137 [celest]
diff --git a/src/map/trade.c b/src/map/trade.c
index b9a22a79a..7bb6f77f5 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -12,6 +12,7 @@
#include "npc.h"
#include "battle.h"
#include "chrif.h"
+#include "storage.h"
#include "intif.h"
#include "atcommand.h"
@@ -57,7 +58,7 @@ void trade_traderequest(struct map_session_data *sd, int target_id) {
*/
void trade_tradeack(struct map_session_data *sd, int type) {
struct map_session_data *target_sd;
-
+ struct storage *stor;
nullpo_retv(sd);
if ((target_sd = map_id2sd(sd->trade_partner)) != NULL) {
@@ -73,6 +74,15 @@ void trade_tradeack(struct map_session_data *sd, int type) {
npc_event_dequeue(sd);
if (target_sd->npc_id != 0)
npc_event_dequeue(target_sd);
+
+ //close STORAGE window if it's open. It protects from spooffing packets [Lupus]
+ nullpo_retv(stor=account2storage2(sd->status.account_id));
+ if(stor->storage_status == 1) {
+ if (sd->state.storage_flag) //is it Guild Storage or Common
+ storage_guild_storageclose(sd);
+ else
+ storage_storageclose(sd);
+ }//END OF STORAGE CLOSE
}
}