On Oct 19, 10 09:36:30 -0700, Keith Packard wrote:
> On Fri,  8 Oct 2010 18:25:12 +0200, Matthias Hopf <[email protected]> wrote:
> 
> > +    if (! (f = fdopen (fd, "r"))) {
> > +   ErrorF ("xorg_backtrace_gdb internal error 2\n");
> > +   close (fd);
> > +   return 1;
> > +    }
> > +    status = 0;
> > +    while (fgets (buf, 256, f)) {
> > +   status++;
> > +   ErrorF("%s", buf);
> > +    }
> > +    fclose (f);
> 
> I'd think you'd want to avoid anything that might allocate memory in
> this code; a rather common crash cause is smashing malloc data.

Hm. Right. fdopen malloc()s. Overlooked that.

Thanks

Matthias

-- 
Matthias Hopf <[email protected]>      __        __   __
Maxfeldstr. 5 / 90409 Nuernberg   (_   | |  (_   |__          [email protected]
Phone +49-911-74053-715           __)  |_|  __)  |__  R & D   www.mshopf.de
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to