- 主题:[FIXED]又发现KBS代码的bug了
之前我装的BBS在执行封禁的时候会导致服务端挂掉,经过检查之后发现代码中
居然出现了数组越界的错误。
int select_deny_reason(char reason[][STRLEN], char *denymsg, int count)
{
struct _select_item sel[count+2];
struct _select_def conf;
struct _simple_select_arg arg;
POINT pts[count+2];
char menustr[count+2][STRLEN];
int i, ret, pos;
for (i=0;i<count+2;i++) {
sel[i].x = (i<10) ? 2 : 40;
sel[i].y = (i<10) ? 4 + i : i - 6;
sel[i].hotkey = (i<9) ? '1' + i : 'A' + i - 9;
sel[i].type = SIT_SELECT;
sel[i].data = menustr[i];
if (i==count)
sprintf(menustr[i], "\033[33m[%c] %s\033[m", sel[i].hotkey, "手动输入封禁理由");
else if (i==count+1)
sprintf(menustr[i], "\033[31m[%c] %s\033[m", sel[i].hotkey, "放弃此次封禁操作");
else
sprintf(menustr[i], "[%c] %s", sel[i].hotkey, reason[i]);
pts[i].x = sel[i].x;
pts[i].y = sel[i].y;
}
sel[i].x = -1;
sel[i].y = -1;
sel[i].hotkey = -1;
sel[i].type = 0;
sel[i].data = NULL;
--
修改:ArchLinux FROM 124.205.76.*
FROM 124.205.77.*
sel越界了?
【 在 ArchLinux (a lightweight and flexible distribution) 的大作中提到: 】
: 之前我装的BBS在执行封禁的时候会导致服务端挂掉,经过检查之后发现代码中
: 居然出现了数组越界的错误。
: int select_deny_reason(char reason[][STRLEN], char *denymsg, int count)
: ...................
--
FROM 123.123.52.*
是啊,看看循环之后i的值是多少,数组开了多大就知道了。
【 在 jiangjun2000 (%d) 的大作中提到: 】
: sel越界了?
--
FROM 124.205.77.*
必须啊,后边还i了一下
【 在 jiangjun2000 (%d) 的大作中提到: 】
: sel越界了?
--
FROM 114.252.51.*
水木好像没这个问题……
【 在 ArchLinux (a lightweight and flexible distribution) 的大作中提到: 】
: 之前我装的BBS在执行封禁的时候会导致服务端挂掉,经过检查之后发现代码中
: 居然出现了数组越界的错误。
: int select_deny_reason(char reason[][STRLEN], char *denymsg, int count)
: ...................
--
FROM 159.226.118.*
那是因为水木那边的用的编译器掩盖了这个错误。
【 在 Jtr (酷热的春天只能靠对面的液氦来降暑) 的大作中提到: 】
: 水木好像没这个问题……
--
FROM 124.205.77.*
我在想,也许用nodejs干脆把这玩意重写了比较好。现在水木架构还没变吧
【 在 ArchLinux (a lightweight and flexible distribution) 的大作中提到: 】
: 之前我装的BBS在执行封禁的时候会导致服务端挂掉,经过检查之后发现代码中
: 居然出现了数组越界的错误。
: int select_deny_reason(char reason[][STRLEN], char *denymsg, int count)
: ...................
--
FROM 68.5.143.*
重写的成本也太高了点,而且新做出来的东西不一定符合老用户的习惯。
不过我觉得水木的代码的确是乱了些,模块化做得不是很好,不过我没写过这样
的大系统,我只是有一种这样的感觉。
【 在 rhoaias (熾天覆う七つの円環ロー) 的大作中提到: 】
: 我在想,也许用nodejs干脆把这玩意重写了比较好。现在水木架构还没变吧
--
FROM 124.205.77.*
别的bug不晓得,不过,现在我是不能发帖……只能回复……然后每次刷新都自动退出,重新登录,然后帐户显示注册时间不明……碉堡了……
--
FROM 125.71.200.*
也不算很大吧
现在bbs系统放眼望去就没什么好用的
web的都是F5刷到爆……
【 在 ArchLinux (a lightweight and flexible distribution) 的大作中提到: 】
: 重写的成本也太高了点,而且新做出来的东西不一定符合老用户的习惯。
: 不过我觉得水木的代码的确是乱了些,模块化做得不是很好,不过我没写过这样
: 的大系统,我只是有一种这样的感觉。
: ...................
--
FROM 68.5.143.*