From f5c7e0e313ec1616f33a610c873741ae73497529 Mon Sep 17 00:00:00 2001 From: in2 Date: Sun, 6 Feb 2005 08:00:07 +0000 Subject: fix another friend[] overflowing in OUTTACACHE git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2473 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/talk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 8765fe40..547d30cd 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -235,7 +235,9 @@ void login_friend_online(void) if( SHM->uinfo[fs.index].uid == fs.uid ){ currutmp->friend_online[currutmp->friendtotal++] = fs.friendstat; - SHM->uinfo[fs.index].friend_online[ SHM->uinfo[fs.index].friendtotal++ ] = fs.rfriendstat; + /* XXX: race here */ + if( SHM->uinfo[fs.index].friendtotal < MAX_FRIEND ) + SHM->uinfo[fs.index].friend_online[ SHM->uinfo[fs.index].friendtotal++ ] = fs.rfriendstat; } /* 要把剩下的收完, 要不然會卡死 utmpserver */ -- cgit v1.2.3