diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-14 10:41:46 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-14 10:41:46 +0000 |
commit | 64c950102f6a680c0ae32bcc9d3e6b843aea9db1 (patch) | |
tree | 1e5aa6e87ff7cd82b0d864007950c273d15fca51 | |
parent | 81ea85071bacd5668a37d3d31f44dd6d1a322e1f (diff) | |
download | hercules-64c950102f6a680c0ae32bcc9d3e6b843aea9db1.tar.gz hercules-64c950102f6a680c0ae32bcc9d3e6b843aea9db1.tar.bz2 hercules-64c950102f6a680c0ae32bcc9d3e6b843aea9db1.tar.xz hercules-64c950102f6a680c0ae32bcc9d3e6b843aea9db1.zip |
Fix for exploit that allowed WPE to create a character with a custom hair style/hair color not available to other players, to then crash them. from the comments within bugreport:150
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15449 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | src/map/status.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/status.c b/src/map/status.c index 7295d7b4f..f77b5f102 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -5078,9 +5078,9 @@ void status_set_viewdata(struct block_list *bl, int class_) sd->vd.head_top = sd->status.head_top; sd->vd.head_mid = sd->status.head_mid; sd->vd.head_bottom = sd->status.head_bottom; - sd->vd.hair_style = sd->status.hair; - sd->vd.hair_color = sd->status.hair_color; - sd->vd.cloth_color = sd->status.clothes_color; + sd->vd.hair_style = cap_value(sd->status.hair,0,battle_config.max_hair_style); + sd->vd.hair_color = cap_value(sd->status.hair,0,battle_config.max_hair_color); + sd->vd.cloth_color = cap_value(sd->status.clothes_color,0,battle_config.max_cloth_color); sd->vd.sex = sd->status.sex; } else if (vd) memcpy(&sd->vd, vd, sizeof(struct view_data)); |