summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-10-23 07:52:47 -0600
committerEduardo Chappa <chappa@washington.edu>2015-10-23 07:52:47 -0600
commit940b52d33995e0af13edf48d5ee6647b7e8b4a17 (patch)
treec1eaa49422e7c19fe1eb9b00a5846271a235e6e2
parent56a5f74f59620a8113db86467edaf589a4038119 (diff)
downloadalpine-940b52d33995e0af13edf48d5ee6647b7e8b4a17.tar.xz
* Crash in Pico when forwarding messages that contain a direction mark
at the end of a line. Reported by James Mingo.
-rw-r--r--pico/pico.c10
-rw-r--r--pith/pine.hlp3
2 files changed, 9 insertions, 4 deletions
diff --git a/pico/pico.c b/pico/pico.c
index d93798c4..93d555d4 100644
--- a/pico/pico.c
+++ b/pico/pico.c
@@ -107,17 +107,19 @@ void
remove_directions_mark(void)
{
LINE *lp;
- int i, ll;
+ int i;
UCS c;
for(lp = lforw(curbp->b_linep); lp != curbp->b_linep; lp = lforw(lp)){
- ll = llength(lp);
- for(i = 0; i < ll;){
+ for(i = 0; i < llength(lp);){
c = lgetc(lp, i).c;
if(c == 0x200E || c == 0x200F){
curwp->w_dotp = lp;
curwp->w_doto = i;
- forwdel(FALSE, 1);
+ if(i < llength(lp))
+ forwdel(FALSE, 1);
+ else
+ llength(lp)--;
direction = c == 0x200E ? 0 : 1;
}
else
diff --git a/pith/pine.hlp b/pith/pine.hlp
index fb087142..986c0ae8 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -344,6 +344,9 @@ Bugs that have been addressed include:
Ulf-Dietrich Braumann.
<LI> Crash when reviewing history of saving attachments.
+
+ <LI> Crash in Pico when forwarding messages that contain a direction mark
+ at the end of a line. Reported by James Mingo.
</UL>