Re: [xslt] Crash in xsltproc



Sorry, sorry, sorry, the error is in libxslt, not in xsltproc, of course.
:-) I just mixed it up, because I saw the crash through xsltproc.

Ciao,
Igor


> Hi there,
>
> The following patch fixes a crash in xsltproc when the document passed
first
> on the command-line isn't a stylesheet.
>
> Basically, the 'xsltParseStylesheetProcess(ret, doc)' returns NULL just
few
> lines above, and the code frees the stylesheet, setting the 'ret' pointer
to
> NULL. The next line of code references 'ret->errors', but 'ret' is now
NULL
> and the OS doesn't forgive the lapse :-)
>
> I'll commit the patch shortly.
>
> Ciao,
> Igor
>
>
>
> RCS file: /cvs/gnome/libxslt/libxslt/xslt.c,v
> retrieving revision 1.91
> diff -c -r1.91 xslt.c
> *** xslt.c      10 May 2003 17:06:57 -0000      1.91
> --- xslt.c      31 May 2003 15:17:46 -0000
> ***************
> *** 1983,1994 ****
>         xsltFreeStylesheet(ret);
>         ret = NULL;
>       }
> !     if (ret->errors != 0) {
> !       ret->doc = NULL;
> !       xsltFreeStylesheet(ret);
> !       ret = NULL;
>       }
> !
>       return(ret);
>   }
>
> --- 1983,1996 ----
>         xsltFreeStylesheet(ret);
>         ret = NULL;
>       }
> !     if (ret != NULL) {
> !       if (ret->errors != 0) {
> !           ret->doc = NULL;
> !           xsltFreeStylesheet(ret);
> !           ret = NULL;
> !       }
>       }
> !
>       return(ret);
>   }
>
>
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt
>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]