diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-27 15:53:41 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-05-27 15:53:41 +0800 |
commit | 7cc44901c5a4c8d57c2d99c483be78ac8cbe72fd (patch) | |
tree | 345f21ef5d17e234721d9da290178fae49f777c2 | |
parent | 998945b8c37f47b9b68842c2dc32066efca6f8e0 (diff) | |
download | pttbbs-7cc44901c5a4c8d57c2d99c483be78ac8cbe72fd.tar pttbbs-7cc44901c5a4c8d57c2d99c483be78ac8cbe72fd.tar.gz pttbbs-7cc44901c5a4c8d57c2d99c483be78ac8cbe72fd.tar.bz2 pttbbs-7cc44901c5a4c8d57c2d99c483be78ac8cbe72fd.tar.lz pttbbs-7cc44901c5a4c8d57c2d99c483be78ac8cbe72fd.tar.xz pttbbs-7cc44901c5a4c8d57c2d99c483be78ac8cbe72fd.tar.zst pttbbs-7cc44901c5a4c8d57c2d99c483be78ac8cbe72fd.zip |
fix a bug of buffer overflow
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@908 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/edit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/edit.c b/pttbbs/mbbsd/edit.c index f3dce0b2..5621ef3f 100644 --- a/pttbbs/mbbsd/edit.c +++ b/pttbbs/mbbsd/edit.c @@ -1,4 +1,4 @@ -/* $Id: edit.c,v 1.30 2003/04/10 06:01:28 in2 Exp $ */ +/* $Id: edit.c,v 1.31 2003/05/27 07:53:41 in2 Exp $ */ #include "bbs.h" typedef struct textline_t { struct textline_t *prev; @@ -1123,7 +1123,7 @@ display_buffer() outs("\033[m"); edit_outs(p->data + max); } else - edit_outs(&p->data[edit_margin]); + edit_outs((edit_margin < p->len) ? &p->data[edit_margin] : ""); p = p->next; if (inblock) outs("\033[m"); |