summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-27 15:53:41 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-27 15:53:41 +0800
commit2f8b3caac65e53406e61587fd58e81115fccb786 (patch)
tree33a95aac6f163261f7cd7b633ebdef1e30ab4e02
parent045d3591db69564e6bdd20bb3d9afe8923862006 (diff)
downloadpttbbs-2f8b3caac65e53406e61587fd58e81115fccb786.tar
pttbbs-2f8b3caac65e53406e61587fd58e81115fccb786.tar.gz
pttbbs-2f8b3caac65e53406e61587fd58e81115fccb786.tar.bz2
pttbbs-2f8b3caac65e53406e61587fd58e81115fccb786.tar.lz
pttbbs-2f8b3caac65e53406e61587fd58e81115fccb786.tar.xz
pttbbs-2f8b3caac65e53406e61587fd58e81115fccb786.tar.zst
pttbbs-2f8b3caac65e53406e61587fd58e81115fccb786.zip
fix a bug of buffer overflow
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@908 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/edit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index f3dce0b2..5621ef3f 100644
--- a/mbbsd/edit.c
+++ b/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");