[xslt] Re: libxml2-2.5.7 and libxslt-1.0.30 -- bugs and patches



On Fri, Jun 13, 2003 at 03:09:43PM +0200, Peter Breitenlohner wrote:
> I am confident I did the bug-fixes right, but someone should certainly check
> that!!!!

  explaining the reasons of the changes would help too ...

> NB: I really think xmlFree should be prototyped differently such that it
> accepts a `const char *' argument without warning, e.g.
> 	void xmlFree(void *);
> or similar.

   xmlFreeFunc xmlFree = (xmlFreeFunc) free;
   typedef void (*xmlFreeFunc)(void *mem);

 So what's your point ? The compiler complains rightly because casting
const char *  to void * means that the pointed area may get changed and
there is nothing to complain about. free() will change the memory, if you
don't care, cast the pointer to something like void *

> 2. Daniel, could you PLEASE PLEASE PLEASE move
> 	man4/libexslt.4 => man3/libexslt.3
> 	man4/libxslt.4 => man3/libxslt.3
> This has already been mentioned a few times on this list (by me and others).

  Move 2 files, change the name, remove them from CVS, add the new one, 
patch the Makefile , patch the spec file,  make sure the rpms still build,
etc ... If it was just moving 2 files I would have done that instantly...
It's commited now.

>  #include <libxml/xpathInternals.h>
> +#include <libxml/uri.h>

  already in CVS,

>  /**
>   * xmlDebugDumpString:
> diff -ur libxml2-2.5.7.orig/relaxng.c libxml2-2.5.7/relaxng.c
> --- libxml2-2.5.7.orig/relaxng.c	2003-04-19 01:49:47.000000000 +0200
> +++ libxml2-2.5.7/relaxng.c	2003-06-13 13:59:04.000000000 +0200
> @@ -6552,7 +6552,7 @@
>      if (ctxt->URL != NULL)
>  	xmlFree(ctxt->URL);
>      if (ctxt->doc != NULL)
> -	xmlFreeDoc(ctxt->doc);
> +	xmlRelaxNGFreeDocument(ctxt->doc);

  already in CVS,

> @@ -7853,7 +7853,7 @@
>  	}
>  	xmlRelaxNGFreeStates(ctxt, ctxt->states);
>  	ctxt->states = NULL;
> -	if ((ret == 0) && (tmp == -1))
> +	if (tmp == -1)

  I see no justification for that, what compiler warning led you to change
that code ? I see no warning with 
   gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include -D_REENTRANT -g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls 

  Looks to me as change in the semantic, of the code, why ?

> diff -ur libxslt-1.0.30.orig/libexslt/sets.c libxslt-1.0.30/libexslt/sets.c
> --- libxslt-1.0.30.orig/libexslt/sets.c	2003-04-23 23:03:40.000000000 +0200
> +++ libxslt-1.0.30/libexslt/sets.c	2003-06-13 13:22:19.000000000 +0200
> @@ -101,8 +101,8 @@
>  exsltSetsDistinctFunction (xmlXPathParserContextPtr ctxt, int nargs) {
>      xmlXPathObjectPtr obj;
>      xmlNodeSetPtr ns, ret;
> -    int boolval;
> -    void *user;
> +    int boolval = 0;
> +    void *user = NULL;

  okay

> --- libxslt-1.0.30.orig/libxslt/variables.c	2003-04-30 21:57:35.000000000 +0200
> +++ libxslt-1.0.30/libxslt/variables.c	2003-06-13 13:30:38.000000000 +0200
> @@ -901,8 +901,8 @@
>      if (ncname == NULL)
>  	return (-1);
>  
> -    res = xmlHashLookup2(ctxt->globalVars, ncname, href);
> -    if (res != 0) {
> +    result = xmlHashLookup2(ctxt->globalVars, ncname, href);
> +    if (result != NULL) {

  Already fixed in CVS, using void *res_ptr; as the 
target.

> diff -ur libxslt-1.0.30.orig/xsltproc/xsltproc.c libxslt-1.0.30/xsltproc/xsltproc.c
> --- libxslt-1.0.30.orig/xsltproc/xsltproc.c	2003-02-24 23:24:43.000000000 +0100
> +++ libxslt-1.0.30/xsltproc/xsltproc.c	2003-06-13 13:25:38.000000000 +0200
> @@ -822,7 +822,7 @@
>      for (i = 0;i < nbstrparams;i++)
>  	xmlFree(strparams[i]);
>      if (output != NULL)
> -	xmlFree(output);
> +	xmlFree((char *)output);

  Fixed in a slightly different way, output is not a const area

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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