[redland] possible defect in rdf_serializer.c (0.9.12)

Dave Beckett Dave.Beckett at bristol.ac.uk
Tue Nov 19 20:55:40 GMT 2002


>>>Seth Ladd said:
> I sent this out once, but I never received it via the mailing list, so 
> please excuse this if it's a repost.
> 
> While playing with 0.9.12 (downloaded Saturday) I discovered what is 
> probably a small defect in rdf_serializer.c.

If that's the snapshot sources, a lot of things are broken near
streams since I've just changed their API and implementation.  More
later....

> In librdf_get_serializer_factory, I believe a '!' needs to get added at 
> the check for uri_equals of the type->uri, near the bottom of the function.
> 
> It should read:
> 
> if(type_uri && factory->type_uri &&
>     ! librdf_uri_equals(factory->type_uri, type_uri)) {
>    continue;
> }
> 
> Once I added this, example4 started to work w/ the included ntriples 
> serializer.  Due to debug statements I added in, the code was previously 
> saying "if the uri of the factory matches the given uri, don't 
> acknowledge it".

That does look wrong.  Thanks for the fix.  I bet I copied that from
some other bit of code, I'll have to check them too.

(One further refactoring to do - pull out the factory registration /
use code into, ahem, a factory)

Dave








More information about the redland-dev mailing list