diff options
author | robertabcd <robertabcd@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-07-31 18:09:32 +0800 |
---|---|---|
committer | robertabcd <robertabcd@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-07-31 18:09:32 +0800 |
commit | 8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8 (patch) | |
tree | bc672ff2ac12b094f0ba376fe001021d9549582b | |
parent | 52dc9cb4b3264d1703b4b8ac4e792e07bad04615 (diff) | |
download | pttbbs-8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8.tar pttbbs-8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8.tar.gz pttbbs-8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8.tar.bz2 pttbbs-8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8.tar.lz pttbbs-8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8.tar.xz pttbbs-8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8.tar.zst pttbbs-8acd0cf8ce1a4d95e482e0a6351b6da2d7baf6e8.zip |
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
-rw-r--r-- | pttbbs/mbbsd/user.c | 10 |
1 files 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 |