On Mon, Jan 23, 2006 at 12:54:22AM +0100, Josip Rodin wrote:
> > > Since the latest "sudo" security update (DSA-946) that joe can't be run
> > > from sudo. It segfaults.
> > > 
> > > >>From the ltrace and strace output it seems that joe segfaults because
> > > sudo doesn't pass along the HOME environment variable anymore.
> > 
> > Yes. Granted, it's silly, but so is sudo changing behaviour in stable. 
> > (#349196)
> 
> The processing function doesn't handle an uninitialized file descriptor,
> apparently, and goes on to read from an unopened fd, which fails miserably.
> This is the trivial fix:
> 
> --- charmap.c~  2006-01-23 00:51:21.000000000 +0100
> +++ charmap.c   2006-01-23 00:51:21.000000000 +0100
> @@ -1273,7 +1273,7 @@
>         unsigned char *p;
>         struct charmap *m;
>         struct builtin_charmap *b;
> -       FILE *f;
> +       FILE *f = NULL;
>         int y;
>  
>         if (!name)

The new upstream version 3.3 already includes a fix for this, it's just
done in a trivially different manner:

--- charmap.c~  2006-01-23 01:03:48.000000000 +0100
+++ charmap.c   2006-01-23 01:03:48.000000000 +0100
@@ -1296,6 +1296,7 @@
 
        /* Check ~/.joe/charmaps */
        p = (unsigned char *)getenv("HOME");
+       f = 0;
        if (p) {
                joe_snprintf_2((char 
*)buf,sizeof(buf),"%s/.joe/charmaps/%s",p,name);
                f = fopen((char *)buf,"r");

-- 
     2. That which causes joy or happiness.


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

Reply via email to