[vlc-devel] [vlc-commits] strings: vlc_xml_encode: check return of vlc_memstream_open

Rémi Denis-Courmont remi at remlab.net
Mon Mar 6 13:41:13 CET 2017


On March 6, 2017 10:12:44 AM GMT+02:00, git at videolan.org wrote:
>vlc | branch: master | Filip Roséen <filip at atch.se> | Fri Feb 24
>21:32:56 2017 +0100| [705a427f75915d9951f62fa86851693dc16a73a7] |
>committer: Jean-Baptiste Kempf
>
>strings: vlc_xml_encode: check return of vlc_memstream_open
>
>As the function is not guaranteed to succeed we should check the
>return-value
>in order to prevent potentially using a handle which is not valid.
>
>Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
>
>>
>http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=705a427f75915d9951f62fa86851693dc16a73a7
>---
>
> src/text/strings.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/src/text/strings.c b/src/text/strings.c
>index eb45145..7adfbcd 100644
>--- a/src/text/strings.c
>+++ b/src/text/strings.c
>@@ -289,7 +289,9 @@ char *vlc_xml_encode (const char *str)
>     uint32_t cp;
> 
>     assert(str != NULL);
>-    vlc_memstream_open(&stream);
>+
>+    if (vlc_memstream_open(&stream))
>+        return NULL;
> 
>     while ((n = vlc_towc (str, &cp)) != 0)
>     {
>
>_______________________________________________
>vlc-commits mailing list
>vlc-commits at videolan.org
>https://mailman.videolan.org/listinfo/vlc-commits

WTF? I am pretty that I rejected this patch.
-- 
Rémi Denis-Courmont


More information about the vlc-devel mailing list