summaryrefslogtreecommitdiff
path: root/pith/charconv
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-07-30 22:37:14 -0600
committerEduardo Chappa <chappa@washington.edu>2015-07-30 22:37:14 -0600
commit599ad097972652603836f39b414075cf625121a8 (patch)
tree6e38ae20abcda147be19ab5b10e1dcea53992e9f /pith/charconv
parent2695b63fbe6c6a2206a2637137c6cd654f69943a (diff)
downloadalpine-599ad097972652603836f39b414075cf625121a8.tar.xz
* Pico: Searching for a string that is too long causes Pico to crash
in the next search.
Diffstat (limited to 'pith/charconv')
-rw-r--r--pith/charconv/utf8.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pith/charconv/utf8.c b/pith/charconv/utf8.c
index b5ce6255..7dd50fdd 100644
--- a/pith/charconv/utf8.c
+++ b/pith/charconv/utf8.c
@@ -2374,6 +2374,7 @@ line_paint(int offset, /* current dot offset into vl */
* is double wide. We don't want the offset to be under that > character.)
*/
for(w = (*width_a_to_b)(displ->vl, displ->vbase, offset);
+ displ->dwid > 1 &&
w + 2 + (displ->vbase ? 1 : 0) > displ->dwid;
w = (*width_a_to_b)(displ->vl, displ->vbase, offset)){
/*
@@ -2431,7 +2432,7 @@ line_paint(int offset, /* current dot offset into vl */
vlast = displ->vused-1; /* end */
w = (*width_a_to_b)(displ->vl, vfirst, vlast);
- if(w + dfirst > displ->dwid){ /* off window right */
+ if(displ->dwid > 0 && w + dfirst > displ->dwid){ /* off window right */
/* find last ucs character to be printed */
while(w + dfirst > displ->dwid - 1) /* -1 for > */