From 3e4693fec74ba2ac35a958a36877a431998bfe29 Mon Sep 17 00:00:00 2001 From: in2 Date: Sun, 6 Feb 2005 07:49:26 +0000 Subject: fix friend[] overflowing when using utmpserver. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2472 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- cacheserver/utmpserver.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cacheserver/utmpserver.c') 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]; -- cgit v1.2.3