[vlc-commits] addons: handle unclosed addon tags

Francois Cartegnie git at videolan.org
Wed Feb 12 02:36:57 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Feb 12 01:36:22 2014 +0100| [eaa5b3205e95fbf6f256ffdf00f72adc08bba77c] | committer: Francois Cartegnie

addons: handle unclosed addon tags

cid #1170827
cid #1170828

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eaa5b3205e95fbf6f256ffdf00f72adc08bba77c
---

 modules/misc/addons/fsstorage.c    |    5 +++++
 modules/misc/addons/vorepository.c |    4 ++++
 2 files changed, 9 insertions(+)

diff --git a/modules/misc/addons/fsstorage.c b/modules/misc/addons/fsstorage.c
index 92647d7..558e92d 100644
--- a/modules/misc/addons/fsstorage.c
+++ b/modules/misc/addons/fsstorage.c
@@ -690,6 +690,9 @@ static int LoadCatalog( addons_finder_t *p_finder )
         {
             if ( ! strcmp( p_node, "addon" ) )
             {
+                if ( p_entry ) /* ?!? Unclosed tag */
+                    addon_entry_Release( p_entry );
+
                 p_entry = addon_entry_New();
                 //p_entry->psz_source_module = strdup( ADDONS_MODULE_SHORTCUT );
                 p_entry->e_flags = ADDON_MANAGEABLE;
@@ -796,6 +799,8 @@ static int LoadCatalog( addons_finder_t *p_finder )
     }
 
 end:
+   if ( p_entry ) /* ?!? Unclosed tag */
+       addon_entry_Release( p_entry );
    xml_ReaderDelete( p_xml_reader );
    stream_Delete( p_stream );
    return i_ret;
diff --git a/modules/misc/addons/vorepository.c b/modules/misc/addons/vorepository.c
index 8a49bd8..bb7cd68 100644
--- a/modules/misc/addons/vorepository.c
+++ b/modules/misc/addons/vorepository.c
@@ -228,6 +228,8 @@ static int ParseCategoriesInfo( addons_finder_t *p_finder, stream_t *p_stream )
         {
             if ( ! strcmp( p_node, "addon" ) )
             {
+                if ( p_entry ) /* Unclosed tag */
+                    addon_entry_Release( p_entry );
                 p_entry = addon_entry_New();
                 p_entry->psz_source_module = strdup( ADDONS_MODULE_SHORTCUT );
                 p_entry->e_flags = ADDON_MANAGEABLE;
@@ -303,6 +305,8 @@ static int ParseCategoriesInfo( addons_finder_t *p_finder, stream_t *p_stream )
     }
 
 end:
+   if ( p_entry ) /* Unclosed tag */
+       addon_entry_Release( p_entry );
    xml_ReaderDelete( p_xml_reader );
    return i_num_entries_created;
 }



More information about the vlc-commits mailing list