diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-12-19 20:56:37 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-12-19 20:56:37 +0000 |
commit | c71cb44f7aa952ba2516db6aae0edb15000e281f (patch) | |
tree | ed24f3be41741543851c58c5436ad4c92c54d69e /src/map | |
parent | a6b815ce9fd7f6e7faaaaa1c5b56be655ee838be (diff) | |
download | hercules-c71cb44f7aa952ba2516db6aae0edb15000e281f.tar.gz hercules-c71cb44f7aa952ba2516db6aae0edb15000e281f.tar.bz2 hercules-c71cb44f7aa952ba2516db6aae0edb15000e281f.tar.xz hercules-c71cb44f7aa952ba2516db6aae0edb15000e281f.zip |
Fixed yet another buffer overflow, in @adopt
(caused by a conflict between a mass replace in r2207 and very dumb variable reuse in r1316)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11955 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index b90d2c6b6..34725dc12 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7495,6 +7495,7 @@ int atcommand_adopt(const int fd, struct map_session_data* sd, const char* comma struct map_session_data *pl_sd2 = NULL; struct map_session_data *pl_sd3 = NULL; char player1[NAME_LENGTH], player2[NAME_LENGTH], player3[NAME_LENGTH]; + char output[256]; nullpo_retr(-1, sd); @@ -7507,20 +7508,20 @@ int atcommand_adopt(const int fd, struct map_session_data* sd, const char* comma printf("Adopting: --%s--%s--%s--\n",player1,player2,player3); if((pl_sd1=map_nick2sd((char *) player1)) == NULL) { - sprintf(player2, "Cannot find player %s online", player1); - clif_displaymessage(fd, player2); + sprintf(output, "Cannot find player %s online", player1); + clif_displaymessage(fd, output); return -1; } if((pl_sd2=map_nick2sd((char *) player2)) == NULL) { - sprintf(player1, "Cannot find player %s online", player2); - clif_displaymessage(fd, player1); + sprintf(output, "Cannot find player %s online", player2); + clif_displaymessage(fd, output); return -1; } if((pl_sd3=map_nick2sd((char *) player3)) == NULL) { - sprintf(player1, "Cannot find player %s online", player3); - clif_displaymessage(fd, player1); + sprintf(output, "Cannot find player %s online", player3); + clif_displaymessage(fd, output); return -1; } |