summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-06 16:00:07 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-06 16:00:07 +0800
commitf5c7e0e313ec1616f33a610c873741ae73497529 (patch)
tree834ee2443e16e63c8b67e547602114c3196f6587 /mbbsd
parent3e4693fec74ba2ac35a958a36877a431998bfe29 (diff)
downloadpttbbs-f5c7e0e313ec1616f33a610c873741ae73497529.tar
pttbbs-f5c7e0e313ec1616f33a610c873741ae73497529.tar.gz
pttbbs-f5c7e0e313ec1616f33a610c873741ae73497529.tar.bz2
pttbbs-f5c7e0e313ec1616f33a610c873741ae73497529.tar.lz
pttbbs-f5c7e0e313ec1616f33a610c873741ae73497529.tar.xz
pttbbs-f5c7e0e313ec1616f33a610c873741ae73497529.tar.zst
pttbbs-f5c7e0e313ec1616f33a610c873741ae73497529.zip
fix another friend[] overflowing in OUTTACACHE
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2473 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/talk.c4
1 files changed, 3 insertions, 1 deletions
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 */