[vlc-devel] commit: Fix XML encoding of our crappy XSPF extensions ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Mar 8 22:28:31 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar  8 23:26:46 2009 +0200| [b10cf471819e36b7211e55daa466b9805553225d] | committer: Rémi Denis-Courmont 

Fix XML encoding of our crappy XSPF extensions

(still not handling errors correctly)

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

 modules/access/directory.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/access/directory.c b/modules/access/directory.c
index 4b3e57a..927efa5 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -383,11 +383,17 @@ static block_t *Block (access_t *p_access)
             if (old_xspf_extension == NULL)
                 goto fatal;
 
-            int len2 = asprintf( &p_sys->psz_xspf_extension, "%s  <vlc:node title=\"%s\">\n", old_xspf_extension, entry );
-            if (len2 == -1)
+            char *title = convert_xml_special_chars (entry);
+            if (title == NULL
+             || asprintf (&p_sys->psz_xspf_extension, "%s"
+                          "  <vlc:node title=\"%s\">\n", old_xspf_extension,
+                          title) == -1)
+            {
+                free (title);
                 goto fatal;
-            free( old_xspf_extension );
-
+            }
+            free (title);
+            free (old_xspf_extension);
             return NULL;
         }
         else




More information about the vlc-devel mailing list