clear out the sequence list; this can cause you to run off the
beginning of the malloc'd buffer. This can happen when you use
"comp" with a draft folder, the draft folder is empty, and you have
a previous sequence set in your .mh_profile. As far as I can tell
this has been a problem for nearly forever, but I only ran into it
recently when adding the readline support. Go figure.
* If sequence is new, or zero flag is set, then first
* clear the bit for this sequence from all messages.
*/
- if (new_seq || zero) {
+ if ((new_seq || zero) && mp->nummsg > 0) {
for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++)
clear_sequence (mp, i, msgnum);
}
* If sequence is new, or zero flag is set, then first
* clear the bit for this sequence from all messages.
*/
- if (new_seq || zero) {
+ if ((new_seq || zero) && mp->nummsg > 0) {
for (j = mp->lowmsg; j <= mp->hghmsg; j++)
clear_sequence (mp, i, j);
}