Bug 3675 - RSSyl crash when opening Atom feed
Summary: RSSyl crash when opening Atom feed
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail
Classification: Unclassified
Component: Plugins/RSSyl (show other bugs)
Version: 3.14.0
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2016-08-21 16:49 CEST by tosh
Modified: 2016-08-21 17:01 CEST (History)
0 users

See Also:


Attachments
The attached file reproduce the bug in the 3.14.0 version. (70 bytes, text/xml)
2016-08-21 16:49 CEST, tosh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description tosh 2016-08-21 16:49:54 CEST
Created attachment 1674 [details]
The attached file reproduce the bug in the 3.14.0 version.

The RSSyl plugin crash when it tries to open an Atom feed where the "xmlns" attribute isn't present in the <feed> tag.

I think the error occures in the _elparse_start_chooser function (parsers.c:90) of the libfeed library :

            /* ATOM feed detected, let's check version */
            version = feed_parser_get_attribute_value(attr, "xmlns");
            if( !strcmp(version, "http://www.w3.org/2005/Atom") ||
                    !strcmp(version, "https://www.w3.org/2005/Atom") )
                feedtype = FEED_TYPE_ATOM_10;
            else
                feedtype = FEED_TYPE_ATOM_03;


In this piece of code, the return of the feed_parser_get_attribute_value isn't checked : a NULL pointer can be passed to the strcmp function if the attribute "xmlns" doesn't exist.

The attached file reproduce the bug in the 3.14.0 version.
Comment 1 users 2016-08-21 17:01:02 CEST
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2016-08-21 17:01:02.703292734 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=1e1ff63e08eb5bef199be54cd0ac1d451028f7ac
Merge: e13190b 7734bcf
Author: Colin Leroy <colin@colino.net>
Date:   Sun Aug 21 17:01:02 2016 +0200

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=7734bcfabb5152ae4d91c1e1f2bb7a29d272e26f
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Sun Aug 21 16:58:22 2016 +0200

    Fix crash when an Atom feed's opening tag doesn't have xmlns attribute.
    
    Closes bug #3675.
Comment 2 Andrej Kacian 2016-08-21 17:01:06 CEST
You are right, I forgot to check whether version is NULL. Fixed in git just now. Thanks!