[vlc-devel] commit: Fix potential segfault (don't dereference strrchr directly) CID 35. ( Rémi Duraffort )

git version control git at videolan.org
Fri Oct 10 23:20:30 CEST 2008


vlc | branch: 0.9-bugfix | Rémi Duraffort <ivoire at videolan.org> | Fri Oct 10 21:08:33 2008 +0200| [b838527c32e0a36b83fd5b2f2db60af0339f1121] | committer: Derk-Jan Hartman 

Fix potential segfault (don't dereference strrchr directly) CID 35.
(cherry picked from commit 74d28b3e26ca08b135ca868f221a2339070c6cd2)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

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

 modules/demux/playlist/sgimb.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/demux/playlist/sgimb.c b/modules/demux/playlist/sgimb.c
index 612e5e7..2023f81 100644
--- a/modules/demux/playlist/sgimb.c
+++ b/modules/demux/playlist/sgimb.c
@@ -218,7 +218,10 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
         psz_bol += sizeof("Stream=\"") - 1;
         if ( !psz_bol )
             return 0;
-        strrchr( psz_bol, '"' )[0] = '\0';
+        char* psz_tmp = strrchr( psz_bol, '"' );
+        if( !psz_tmp )
+            return 0;
+        psz_tmp[0] = '\0';
         /* We cheat around xdma. for some reason xdma links work different then rtsp */
         if( !strncasecmp( psz_bol, "xdma://", sizeof("xdma://") - 1 ) )
         {




More information about the vlc-devel mailing list