Fix crash when an Atom feed's opening tag doesn't have xmlns attribute.
authorAndrej Kacian <ticho@claws-mail.org>
Sun, 21 Aug 2016 14:58:22 +0000 (16:58 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sun, 21 Aug 2016 14:58:22 +0000 (16:58 +0200)
Closes bug #3675.

src/plugins/rssyl/libfeed/parser.c

index 033f800..68694ab 100644 (file)
@@ -87,8 +87,9 @@ static void _elparse_start_chooser(void *data,
 
                        /* 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") )
+                       if( version != NULL &&
+                                       (!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;