On Sat, Jun 17, 2006 at 11:29:35PM +0200, John wrote:
> There's some error checking missing in StatusLine.cc, in 3.4.7 and CVS:
>
> const char *StatusLine::prev_line = get_string_term_cap("cuu1","up");
>
> This will leave the above variables with NULLs in case the
> capabilities aren't found, causing StatusLine::update to segfault when
> it tries to use them anyway, like:
>   write(fd,prev_line,strlen(prev_line));

Please try this patch.

--
   Alexander.
Index: StatusLine.cc
===================================================================
RCS file: /home/lav/cvsroot/lftp/src/StatusLine.cc,v
retrieving revision 1.34
diff -u -p -r1.34 StatusLine.cc
--- StatusLine.cc       6 Feb 2006 11:04:00 -0000       1.34
+++ StatusLine.cc       19 Jun 2006 05:58:38 -0000
@@ -193,6 +193,8 @@ void StatusLine::update(const char *cons
 
    // clear old extra lines. Assume we are at beginning of last shown line.
    int j=shown.Count();
+   if(!prev_line)    // if there is no way to go up, show a single line only.
+      j=newstr_height=1;
    int i=j-newstr_height;
    char *spaces=string_alloca(w+1);
    memset(spaces,' ',w);

Reply via email to