tags 446274 + patch
thanks

On tor, 2007-10-11 at 13:25 -0700, Mark Nudelman wrote:
> On 10/11/2007 9:59 AM, Andreas Henriksson wrote:
> > I just reported a segfault in less to the Debian bug tracking system.
> > See: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=446274
> > When I search in less having the attached file open I get a segfault on
> > my Debian Unstable (less 408) AMD64 machine. I can not reproduce this on
> > My Debian Stable/Etch (less 394) i386 machine, so maybe it's a "new"
> > regression?
> 
> Hi Andreas,
> This is indeed a new bug in less-408.  I think the patch below fixes it. 
>   If you want to try the patch, let me know if it works for you.
> 
> --Mark

Works for me! Thanks! :)

> 
> 
> diff -c -r1.26 charset.c
> *** charset.c   2007/09/28 14:48:33     1.26
> --- charset.c   2007/10/11 20:23:32
> ***************
> *** 668,673 ****
> --- 668,674 ----
>          char *limit;
>    {
>          LWCHAR ch;
> +       int len;
>          char *p = *pp;
> 
>          if (!utf_mode)
> ***************
> *** 679,692 ****
>                          ch = (LWCHAR) ((p > limit) ? *--p : 0);
>          } else if (dir > 0)
>          {
> !               if (p + utf_len(*p) > limit)
>                          ch = 0;
> !               else
>                  {
>                          ch = get_wchar(p);
> !                       p++;
> !                       while (IS_UTF8_TRAIL(*p))
> !                               p++;
>                  }
>          } else
>          {
> --- 680,694 ----
>                          ch = (LWCHAR) ((p > limit) ? *--p : 0);
>          } else if (dir > 0)
>          {
> !               len = utf_len(*p);
> !               if (p + len > limit)
> !               {
>                          ch = 0;
> !                       p = limit;
> !               } else
>                  {
>                          ch = get_wchar(p);
> !                       p += len;
>                  }
>          } else
>          {




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to