summaryrefslogtreecommitdiffstats
path: root/cacheserver/utmpserver.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-06 15:49:26 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-06 15:49:26 +0800
commit3e4693fec74ba2ac35a958a36877a431998bfe29 (patch)
tree85a6e84996963a0578c3bd0208a0b1afdca12a01 /cacheserver/utmpserver.c
parent6992814160ed9cb2a62cb6af943d1bf1a0c09f78 (diff)
downloadpttbbs-3e4693fec74ba2ac35a958a36877a431998bfe29.tar
pttbbs-3e4693fec74ba2ac35a958a36877a431998bfe29.tar.gz
pttbbs-3e4693fec74ba2ac35a958a36877a431998bfe29.tar.bz2
pttbbs-3e4693fec74ba2ac35a958a36877a431998bfe29.tar.lz
pttbbs-3e4693fec74ba2ac35a958a36877a431998bfe29.tar.xz
pttbbs-3e4693fec74ba2ac35a958a36877a431998bfe29.tar.zst
pttbbs-3e4693fec74ba2ac35a958a36877a431998bfe29.zip
fix friend[] overflowing when using utmpserver.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2472 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'cacheserver/utmpserver.c')
-rw-r--r--cacheserver/utmpserver.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cacheserver/utmpserver.c b/cacheserver/utmpserver.c
index 592cd7d0..82832b8f 100644
--- a/cacheserver/utmpserver.c
+++ b/cacheserver/utmpserver.c
@@ -117,6 +117,8 @@ int main(int argc, char **argv)
if( toread(cfd, &uid, sizeof(uid)) > 0 &&
toread(cfd, utmp[index].friend, sizeof(utmp[index].friend)) > 0 &&
toread(cfd, utmp[index].reject, sizeof(utmp[index].reject)) > 0 ){
+ /* 因為 logout 的時候並不會通知 utmpserver , 可能會查到一些
+ 已經 logout 的帳號。所以不能只取 MAX_FRIEND 而要多取一些 */
#define MAX_FS (2 * MAX_FRIEND)
int iu, nFrs, stat, rstat;
ocfs_t fs[MAX_FS];