summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2011-10-14 09:39:46 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2011-10-14 09:39:46 +0800
commit77dfa7dc6eaab063315083e05728cf174cc49bda (patch)
tree43ead81724f2225f6979e95f496ada2d4be820dd
parent662a63b5651d4274425140cd0b705e318a8d24bc (diff)
downloadpttbbs-77dfa7dc6eaab063315083e05728cf174cc49bda.tar
pttbbs-77dfa7dc6eaab063315083e05728cf174cc49bda.tar.gz
pttbbs-77dfa7dc6eaab063315083e05728cf174cc49bda.tar.bz2
pttbbs-77dfa7dc6eaab063315083e05728cf174cc49bda.tar.lz
pttbbs-77dfa7dc6eaab063315083e05728cf174cc49bda.tar.xz
pttbbs-77dfa7dc6eaab063315083e05728cf174cc49bda.tar.zst
pttbbs-77dfa7dc6eaab063315083e05728cf174cc49bda.zip
fix: out of resource if alohaed contains user himself
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5423 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/friend.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pttbbs/mbbsd/friend.c b/pttbbs/mbbsd/friend.c
index 48ebc9bd..90929443 100644
--- a/pttbbs/mbbsd/friend.c
+++ b/pttbbs/mbbsd/friend.c
@@ -326,6 +326,9 @@ static void
delete_user_friend(const char *uident, const char *thefriend, int type)
{
char fn[PATHLEN];
+ // some stupid user simply set themselves and caused recursion here.
+ if (strcasecmp(uident, thefriend) == 0)
+ return;
sethomefile(fn, uident, "aloha");
delete_friend_from_file(fn, thefriend, 0);
}