[MPlayer-dev-eng] [PATCH 1/2] libmpdemux/mf: Replace sprintf by mp_asprintf

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Apr 28 22:09:00 EEST 2021


> @@ -142,19 +143,23 @@ mf_t* open_mf(char * filename){
> 
>  while ( error_count < 5 )
>   {
> -   sprintf( fname,filename,count++ );
> +   fname = mp_asprintf( filename,count++ );

A new variable local to this block would make it much easier to argue memory correctness.
This probably also applies to the other usages of this “fname” variable,
but that’s a somewhat separate issue. 


More information about the MPlayer-dev-eng mailing list