diff --git a/modules/access/dsm/access.c b/modules/access/dsm/access.c index 10eabe2ec4..8e2c36a216 100644 --- a/modules/access/dsm/access.c +++ b/modules/access/dsm/access.c @@ -645,7 +645,7 @@ static bool get_path( stream_t *p_access ) backslash_path( p_sys->psz_fullpath ); /* Is path longer than just "/" ? */ - if( strlen( p_sys->psz_fullpath ) > 1 ) + if( strnlen( p_sys->psz_fullpath, 1+1 ) > 1 ) { iter = p_sys->psz_fullpath; while( *iter == '\\' ) iter++; /* Handle smb://Host/////Share/ */ diff --git a/modules/codec/atsc_a65.c b/modules/codec/atsc_a65.c index 26cb0ad825..f6afa978e0 100644 --- a/modules/codec/atsc_a65.c +++ b/modules/codec/atsc_a65.c @@ -72,7 +72,7 @@ atsc_a65_handle_t *atsc_a65_handle_New( const char *psz_lang ) atsc_a65_handle_t *p_handle = malloc( sizeof(*p_handle) ); if( p_handle ) { - if( psz_lang && strlen(psz_lang) > 2 ) + if( psz_lang && strnlen(psz_lang, 2+1) > 2 ) p_handle->psz_lang = strdup( psz_lang ); else p_handle->psz_lang = NULL; diff --git a/modules/codec/libass.c b/modules/codec/libass.c index 475ac7e41c..c1ba15b3f5 100644 --- a/modules/codec/libass.c +++ b/modules/codec/libass.c @@ -180,7 +180,7 @@ static int Create( vlc_object_t *p_this ) if( !strcasecmp( p_attach->psz_mime, "application/x-truetype-font" ) ) found = true; /* Then extension */ - else if( !found && strlen( p_attach->psz_name ) > 4 ) + else if( !found && strnlen( p_attach->psz_name, 4+1 ) > 4 ) { char *ext = p_attach->psz_name + strlen( p_attach->psz_name ) - 4; diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c index 7e6aed88bf..fbe9ddf93e 100644 --- a/modules/demux/mjpeg.c +++ b/modules/demux/mjpeg.c @@ -507,7 +507,7 @@ static int MimeDemux( demux_t *p_demux ) /* Handle old and new style of separators */ if (!strncmp(p_sys->psz_separator, (char *)(p_sys->p_peek + i + 2), strlen( p_sys->psz_separator )) - || ((strlen(p_sys->psz_separator) > 4) + || ((strnlen(p_sys->psz_separator, 4+1) > 4) && !strncmp(p_sys->psz_separator, "--", 2) && !strncmp(p_sys->psz_separator, (char *)(p_sys->p_peek + i), strlen( p_sys->psz_separator)))) diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp index a1e1b8559a..681c45ed6d 100644 --- a/modules/demux/mkv/mkv.cpp +++ b/modules/demux/mkv/mkv.cpp @@ -192,7 +192,7 @@ static int OpenInternal( demux_t *p_demux, bool trust_cues ) const char *psz_file; while ((psz_file = vlc_readdir(p_src_dir)) != NULL) { - if (strlen(psz_file) > 4) + if (strnlen(psz_file, 4+1) > 4) { s_filename = s_path + DIR_SEP_CHAR + psz_file; diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c index 7c030da425..dbb0859c37 100644 --- a/modules/stream_out/rtp.c +++ b/modules/stream_out/rtp.c @@ -766,7 +766,7 @@ char *SDPGenerate( sout_stream_t *p_stream, const char *rtsp_url ) inclport = false; /* Check against URL format rtsp://[]:/ */ - bool ipv6 = rtsp_url != NULL && strlen( rtsp_url ) > 7 + bool ipv6 = rtsp_url != NULL && strnlen( rtsp_url, 7+1 ) > 7 && rtsp_url[7] == '['; /* Dummy destination address for RTSP */