diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-10-16 06:26:40 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-10-16 06:26:40 +0000 |
commit | f87f36b82dbf7f907555fed2fdd8efab8f869ea6 (patch) | |
tree | 55558da0c98aef3350b3f45c02b5eccbea2b11c5 /src/map/clif.h | |
parent | 1fabc2250529b3ed092c2635c09023d8dd6f74e9 (diff) | |
download | hercules-f87f36b82dbf7f907555fed2fdd8efab8f869ea6.tar.gz hercules-f87f36b82dbf7f907555fed2fdd8efab8f869ea6.tar.bz2 hercules-f87f36b82dbf7f907555fed2fdd8efab8f869ea6.tar.xz hercules-f87f36b82dbf7f907555fed2fdd8efab8f869ea6.zip |
* Fixed public/guild chat message packets sending strings without zero-termination causing recent clients to display trailing junk on such messages (bugreport:5068).
- Changed memcpy to safestrncpy in message packets where overlong messages are truncated (thus loose zero-termination).
- Replaced dynamic allocation in clif_guild_message with buffer from stack.
- Fixed clif_disp_message not checking whether the message fits into provided buffer.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14975 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.h')
-rw-r--r-- | src/map/clif.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/clif.h b/src/map/clif.h index f68204361..e34ff55a0 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -437,7 +437,7 @@ int clif_guild_memberpositionchanged(struct guild *g,int idx); int clif_guild_emblem(struct map_session_data *sd,struct guild *g); void clif_guild_emblem_area(struct block_list* bl); int clif_guild_notice(struct map_session_data *sd,struct guild *g); -int clif_guild_message(struct guild *g,int account_id,const char *mes,int len); +void clif_guild_message(struct guild *g,int account_id,const char *mes,int len); int clif_guild_skillup(struct map_session_data *sd,int skill_num,int lv); int clif_guild_reqalliance(struct map_session_data *sd,int account_id,const char *name); int clif_guild_allianceack(struct map_session_data *sd,int flag); @@ -468,7 +468,7 @@ int clif_font(struct map_session_data *sd); // atcommand int clif_displaymessage(const int fd,const char* mes); -int clif_disp_onlyself(struct map_session_data *sd,const char *mes,int len); +void clif_disp_onlyself(struct map_session_data *sd,const char *mes,int len); void clif_disp_message(struct block_list* src, const char* mes, int len, enum send_target target); int clif_broadcast(struct block_list *bl, const char* mes, int len, int type, enum send_target target); void clif_MainChatMessage(const char* message); //luzza @@ -502,7 +502,7 @@ void clif_weather(int m); // [Valaris] int clif_specialeffect(struct block_list* bl, int type, enum send_target target); // special effects [Valaris] void clif_specialeffect_single(struct block_list* bl, int type, int fd); int clif_messagecolor(struct block_list* bl, unsigned long color, const char* msg); // Mob/Npc color talk [SnakeDrak] -int clif_message(struct block_list *bl, const char* msg); // messages (from mobs/npcs) [Valaris] +void clif_message(struct block_list *bl, const char* msg); // messages (from mobs/npcs) [Valaris] int clif_GM_kickack(struct map_session_data *sd,int id); void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd); @@ -510,7 +510,7 @@ void clif_manner_message(struct map_session_data* sd, uint32 type); void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, uint8 type); int clif_timedout(struct map_session_data *sd); -int clif_disp_overhead(struct map_session_data *sd, const char* mes); +void clif_disp_overhead(struct map_session_data *sd, const char* mes); void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand); |