diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-27 13:04:05 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-27 13:04:05 +0800 |
commit | 669158ebbf8b97b044bb2735bee11c533470805b (patch) | |
tree | bd120f19dcf12fd2a4bb2608d3f92bd01ad18a30 | |
parent | b1bf4e8a767b2feb1dbeb417658ac2c58a13f86b (diff) | |
download | pttbbs-669158ebbf8b97b044bb2735bee11c533470805b.tar pttbbs-669158ebbf8b97b044bb2735bee11c533470805b.tar.gz pttbbs-669158ebbf8b97b044bb2735bee11c533470805b.tar.bz2 pttbbs-669158ebbf8b97b044bb2735bee11c533470805b.tar.lz pttbbs-669158ebbf8b97b044bb2735bee11c533470805b.tar.xz pttbbs-669158ebbf8b97b044bb2735bee11c533470805b.tar.zst pttbbs-669158ebbf8b97b044bb2735bee11c533470805b.zip |
buf overflow of vmsg
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1872 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbs.c | 2 | ||||
-rw-r--r-- | mbbsd/stuff.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 3ac99fd7..9f07f2e3 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1879,7 +1879,7 @@ view_postmoney(int ent, fileheader_t * fhdr, char *direct) if(fhdr->filemode & FILE_ANONYMOUS) /* When the file is anonymous posted, fhdr->money is author. * see do_general() */ - vmsg("匿名管理編號: %d (同一人被查詢時編號相同, 此編號每人看到不相同)", + vmsg("匿名管理編號: %d (同一人號碼會一樣)", fhdr->money + currutmp->pid); else vmsg("這一篇文章值 %d 銀", fhdr->money); diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 7f5e495a..dd8bb969 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -428,7 +428,7 @@ vmsg_lines(const int lines, const char msg[]) int getans(const char *fmt,...) { - char msg[128] = {0}; + char msg[256] = {0}; va_list ap; va_start(ap, fmt); vsnprintf(msg, sizeof(msg), fmt, ap); @@ -439,15 +439,15 @@ getans(const char *fmt,...) int vmsg(const char *fmt,...) { - char msg[128] = "\033[1;36;44m ◆ ", i; + char msg[256] = "\033[1;36;44m ◆ ", i; va_list ap; va_start(ap, fmt); i = vsnprintf(msg+14, 100, fmt, ap); va_end(ap); - for(i=i+14; i<69; i++) + for(i=i+14; i<71; i++) *(msg+i) = ' '; - strcat(msg+69, - "\033[33;46m \033[200m\033[1431m\033[506m[請按任意鍵繼續]\033[201m \033[m"); + strcat(msg+71, + "\033[33;46m \033[200m\033[1431m\033[506m[按任意鍵繼續]\033[201m \033[m"); return vmsg_lines(b_lines, msg); } |