lwindolf/liferea — pull request #98 by ap (2014-09-19 12:44:50+00:00)
Title: Stop calling Atom person constructs w/ URI invalid

If I am reading the code right, then the conditional I have patched is supposed to do the same thing as the one in the block that parses `email` elements.

Namely, the `email` variable is initialised to `NULL`, so if it already had an allocation when an `` element is encountered, then there must have been another `` element in the person construct before, and this second `` constitutes an error per RFC 4287.

RFC 4287 specifies the same arity for the `` element, i.e. zero or one `` elements. The code also initialises the `uri` variable to `NULL` just like the `email` variable.

But the block that parses `` elements checks if the `uri` variable is **not** `NULL`. If my reading of the code is right, this check will *always* be true when the *first* `` element is encountered, so *any* person construct that contains a URI will be declared invalid.

This is a bug. The condition needs to be negated.

I noticed this because I recently finally upgraded from 1.8.x, and in many of my feeds, the author metadata suddenly stopped showing up. If this is not the cause of the problem (which it sure seems to be), then there must still be a bug somewhere else.