--- WWW/Library/Implementation/HTMIME.c.old 2004-01-08 03:03:09.000000000 +0100 +++ WWW/Library/Implementation/HTMIME.c 2005-09-25 17:25:02.499592560 +0200 @@ -2230,7 +2230,7 @@ PUBLIC int HTrjis ARGS2( strcpy(t, s); return 1; } - for (p = buf; *s; ) { + for (p = buf; *s && p < buf + LINE_LENGTH - 8; ) { if (!kanji && s[0] == '$' && (s[1] == '@' || s[1] == 'B')) { if (HTmaybekanji((int)s[2], (int)s[3])) { kanji = 1; @@ -2253,7 +2253,7 @@ PUBLIC int HTrjis ARGS2( } *p++ = *s++; } - *p = *s; /* terminate string */ + *p = '\0'; /* terminate string */ strcpy(t, buf); return 0;