Fix crash when an Atom feed's opening tag doesn't have xmlns attribute.
[claws.git] / src / plugins / rssyl / libfeed / parser.c
index 033f8001ef2a24d642e0a9371165fa67d56807d3..68694abd370e43f34f08e935612c6aecd071fc88 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;