diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-18 00:36:16 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-18 00:36:16 +0000 |
commit | 6bad47558aa533c5ba589a4ac8e1dfde3028537e (patch) | |
tree | 6e05ee15c54f33ec6b99a0ee04844e84e0d2dca4 | |
parent | f06d3b26ad08bb054b6593fac39042cb20649c36 (diff) | |
download | hercules-6bad47558aa533c5ba589a4ac8e1dfde3028537e.tar.gz hercules-6bad47558aa533c5ba589a4ac8e1dfde3028537e.tar.bz2 hercules-6bad47558aa533c5ba589a4ac8e1dfde3028537e.tar.xz hercules-6bad47558aa533c5ba589a4ac8e1dfde3028537e.zip |
- Fixed possible crash due to invalid index in the pet select packet.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5314 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/map/pet.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 8e1686e58..3226156f1 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/02/17
+ * Fixed possible crash on pet egg select. [Skotlex]
* Massive update on the way splash/area (non-ground) skills work. [Skotlex]
- the new column 'splash' in skill_db is now used to determine the area of
effect of all related skills (eg: splash range of fireball, area of effect
diff --git a/src/map/pet.c b/src/map/pet.c index 9177440d4..ad9a4ddbc 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -1068,6 +1068,9 @@ int pet_select_egg(struct map_session_data *sd,short egg_index) {
nullpo_retr(0, sd);
+ if(egg_index < 0 || egg_index >= MAX_INVENTORY)
+ return 0; //Forged packet!
+
if(sd->status.inventory[egg_index].card[0] == (short)0xff00)
intif_request_petdata(sd->status.account_id, sd->status.char_id, MakeDWord(sd->status.inventory[egg_index].card[1], sd->status.inventory[egg_index].card[2]) );
else {
|