Commit 74d28b3e authored by Rémi Duraffort's avatar Rémi Duraffort

Fix potential segfault (don't dereference strrchr directly) CID 35.

parent 78a1fdbc
...@@ -218,7 +218,10 @@ static int ParseLine ( demux_t *p_demux, char *psz_line ) ...@@ -218,7 +218,10 @@ static int ParseLine ( demux_t *p_demux, char *psz_line )
psz_bol += sizeof("Stream=\"") - 1; psz_bol += sizeof("Stream=\"") - 1;
if ( !psz_bol ) if ( !psz_bol )
return 0; 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 */ /* We cheat around xdma. for some reason xdma links work different then rtsp */
if( !strncasecmp( psz_bol, "xdma://", sizeof("xdma://") - 1 ) ) if( !strncasecmp( psz_bol, "xdma://", sizeof("xdma://") - 1 ) )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment