summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-01 02:16:33 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-07-01 02:16:33 +0800
commit460851d46c3093a1790a0612e16b0820bc7bee1f (patch)
tree20597e5388efbe551dc82c7fa73c0c1c0bc9496c
parentb58ea328268306ae79026d97c9c63930d0bae6ce (diff)
downloadpttbbs-460851d46c3093a1790a0612e16b0820bc7bee1f.tar
pttbbs-460851d46c3093a1790a0612e16b0820bc7bee1f.tar.gz
pttbbs-460851d46c3093a1790a0612e16b0820bc7bee1f.tar.bz2
pttbbs-460851d46c3093a1790a0612e16b0820bc7bee1f.tar.lz
pttbbs-460851d46c3093a1790a0612e16b0820bc7bee1f.tar.xz
pttbbs-460851d46c3093a1790a0612e16b0820bc7bee1f.tar.zst
pttbbs-460851d46c3093a1790a0612e16b0820bc7bee1f.zip
avoid utmp->friendtotal error
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@397 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/util/shmctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pttbbs/util/shmctl.c b/pttbbs/util/shmctl.c
index 2ce7982b..348b6024 100644
--- a/pttbbs/util/shmctl.c
+++ b/pttbbs/util/shmctl.c
@@ -1,4 +1,4 @@
-/* $Id: shmctl.c,v 1.22 2002/06/26 01:57:49 in2 Exp $ */
+/* $Id: shmctl.c,v 1.23 2002/06/30 18:16:33 in2 Exp $ */
#include "bbs.h"
extern SHM_t *SHM;
@@ -9,6 +9,8 @@ int logout_friend_online(userinfo_t *utmp)
int offset=(int) (utmp - &SHM->uinfo[0]);
userinfo_t *ui;
while(utmp->friendtotal){
+ if( !(0 <= utmp->friendtotal && utmp->friendtotal < MAX_FRIEND) )
+ return 1;
i = utmp->friendtotal-1;
j = (utmp->friend_online[i] & 0xFFFFFF);
if( !(0 <= j && j < MAX_ACTIVE) )