Commit 8ecb5ba1 authored by Rémi Duraffort's avatar Rémi Duraffort

fix buffer overflows.

parent 5339bb3f
...@@ -1438,8 +1438,8 @@ static void Usage( libvlc_int_t *p_this, char const *psz_search ) ...@@ -1438,8 +1438,8 @@ static void Usage( libvlc_int_t *p_this, char const *psz_search )
#endif #endif
char psz_spaces_text[PADDING_SPACES+LINE_START+1]; char psz_spaces_text[PADDING_SPACES+LINE_START+1];
char psz_spaces_longtext[LINE_START+3]; char psz_spaces_longtext[LINE_START+3];
char psz_format[sizeof(COLOR_FORMAT_STRING)]; char psz_format[sizeof(COLOR_FORMAT_STRING) + 1];
char psz_format_bool[sizeof(COLOR_FORMAT_STRING_BOOL)]; char psz_format_bool[sizeof(COLOR_FORMAT_STRING_BOOL) + 1];
char psz_buffer[10000]; char psz_buffer[10000];
char psz_short[4]; char psz_short[4];
int i_width = ConsoleWidth() - (PADDING_SPACES+LINE_START+1); int i_width = ConsoleWidth() - (PADDING_SPACES+LINE_START+1);
......
...@@ -212,11 +212,11 @@ int playlist_MLDump( playlist_t *p_playlist ) ...@@ -212,11 +212,11 @@ int playlist_MLDump( playlist_t *p_playlist )
if( !config_GetInt( p_playlist, "media-library") ) return VLC_SUCCESS; if( !config_GetInt( p_playlist, "media-library") ) return VLC_SUCCESS;
if( !psz_datadir ) /* XXX: This should never happen */ if( !psz_datadir ) /* XXX: This should never happen */
{ {
msg_Err( p_playlist, "no data directory, cannot save media library") ; msg_Err( p_playlist, "no data directory, cannot save media library");
return VLC_EGENERIC; return VLC_EGENERIC;
} }
char psz_dirname[ strlen( psz_datadir ) + sizeof( DIR_SEP "ml.xspf")]; char psz_dirname[strlen( psz_datadir ) + sizeof( DIR_SEP "ml.xspf" ) + 1];
strcpy( psz_dirname, psz_datadir ); strcpy( psz_dirname, psz_datadir );
free( psz_datadir ); free( psz_datadir );
if( config_CreateDir( (vlc_object_t *)p_playlist, psz_dirname ) ) if( config_CreateDir( (vlc_object_t *)p_playlist, psz_dirname ) )
......
...@@ -267,7 +267,7 @@ char *vlc_sdp_Start (vlc_object_t *obj, const char *cfgpref, ...@@ -267,7 +267,7 @@ char *vlc_sdp_Start (vlc_object_t *obj, const char *cfgpref,
if (cfglen > 100) if (cfglen > 100)
return NULL; return NULL;
char varname[cfglen + sizeof ("description")], *subvar = varname + cfglen; char varname[cfglen + sizeof ("description") + 1], *subvar = varname + cfglen;
strcpy (varname, cfgpref); strcpy (varname, cfgpref);
strcpy (subvar, "name"); strcpy (subvar, "name");
......
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