summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/friend.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mbbsd/friend.c b/mbbsd/friend.c
index 4ec98f9a..db36a8cc 100644
--- a/mbbsd/friend.c
+++ b/mbbsd/friend.c
@@ -74,15 +74,18 @@ friend_add(const char *uident, int type, const char* des)
if ((uident[0] > ' ') && !belong(fpath, uident)) {
char buf[STRLEN] = "", buf2[256];
char t_uident[IDLEN + 1];
+ const maxdesclen = 40; //
+
+ assert(maxdesclen <= sizeof(buf));
/* Thor: avoid uident run away when get data */
strlcpy(t_uident, uident, sizeof(t_uident));
if (type != FRIEND_ALOHA && type != FRIEND_POST){
if(!des)
- getdata(2, 0, friend_desc[type], buf, sizeof(buf), DOECHO);
+ getdata(2, 0, friend_desc[type], buf, maxdesclen, DOECHO);
else
- getdata_str(2, 0, friend_desc[type], buf, sizeof(buf), DOECHO, des);
+ getdata_str(2, 0, friend_desc[type], buf, maxdesclen, DOECHO, des);
}
snprintf(buf2, sizeof(buf2), "%-13s%s\n", t_uident, buf);