Skip to content
Snippets Groups Projects
Commit b91f331f authored by Lyndon Brown's avatar Lyndon Brown
Browse files

vorepository: use vlc_MakeTmpFile (thus mkstemp) instead of tempnam

resolves warning about insecure function
parent 9a3e5c0d
No related branches found
No related tags found
No related merge requests found
......@@ -400,20 +400,10 @@ static int Retrieve( addons_finder_t *p_finder, addon_entry_t *p_entry )
FREENULL( p_finder->p_sys->psz_tempfile );
}
p_finder->p_sys->psz_tempfile = tempnam( NULL, "vlp" );
if ( !p_finder->p_sys->psz_tempfile )
{
msg_Err( p_finder, "Can't create temp storage file" );
vlc_stream_Delete( p_stream );
return VLC_EGENERIC;
}
int fd = vlc_open( p_finder->p_sys->psz_tempfile,
O_WRONLY | O_CREAT | O_EXCL, 0600 );
int fd = vlc_MakeTmpFile(&p_finder->p_sys->psz_tempfile, PACKAGE_NAME"-vlp.XXXXXX", NULL);
if( fd == -1 )
{
msg_Err( p_finder, "Failed to open addon temp storage file" );
FREENULL(p_finder->p_sys->psz_tempfile);
msg_Err( p_finder, "Can't create temp storage file" );
vlc_stream_Delete( p_stream );
return VLC_EGENERIC;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment