From 8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8 Mon Sep 17 00:00:00 2001 From: robertabcd Date: Tue, 31 Jul 2012 10:09:32 +0000 Subject: Fix bug: ban user using angel subsystem will fail due to copying userid from an uninitialized struct. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5692 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/mbbsd/user.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c index 69e7c904..9e5372f4 100644 --- a/pttbbs/mbbsd/user.c +++ b/pttbbs/mbbsd/user.c @@ -776,17 +776,19 @@ uinfo_query(const char *orig_uid, int adminmode, int unum) userec_t xuser; getdata_str(y, 0, prompt, buf, IDLEN + 1, DOECHO, x.myangel); + if(buf[0] == 0 || strcmp(buf, "-") == 0 || - (getuser(buf, &xuser) && - (xuser.userlevel & PERM_ANGEL)) || - strcmp(x.myangel, buf) == 0){ + strcmp(x.myangel, buf) == 0) + break; + + if (getuser(buf, &xuser) && (xuser.userlevel & PERM_ANGEL)) { strlcpy(x.myangel, xuser.userid, IDLEN + 1); - ++y; break; } prompt = "¤p ¤Ñ ¨Ï¡G"; } + ++y; } #endif -- cgit v1.2.3