fix #1135: another "off by one" bug, zero termination was done twice, second time writing behind the end of the available buffer

svn path=/trunk/; revision=19566
This commit is contained in:
Ulf Lamping 2006-10-16 23:13:21 +00:00
parent 4e7f9204ca
commit 0c23562511
1 changed files with 4 additions and 0 deletions

View File

@ -244,6 +244,10 @@ unfold_and_compact_mime_header(const char *lines, gint *first_colon_offset)
break;
}
}
/* if already zero terminated now, rewind one char to avoid an "off by one" */
if(c == 0) {
q--;
}
} else { /* Regular character */
if (sep_seen) {
sep_seen = 0;