Browse Source

disallow strcat

Originally committed as revision 3826 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 21 years ago
parent
commit
1f3f950799
2 changed files with 5 additions and 3 deletions
  1. +1
    -0
      libavcodec/common.h
  2. +4
    -3
      vhook/ppm.c

+ 1
- 0
libavcodec/common.h View File

@@ -500,6 +500,7 @@ tend= rdtsc();\
#define rand rand_is_forbidden_due_to_state_trashing
#define srand srand_is_forbidden_due_to_state_trashing
#define sprintf sprintf_is_forbidden_due_to_security_issues_use_snprintf
#define strcat strcat_is_forbidden_due_to_security_issues_use_pstrcat
#if !(defined(LIBAVFORMAT_BUILD) || defined(_FRAMEHOOK_H))
#define printf please_use_av_log
#define fprintf please_use_av_log


+ 4
- 3
vhook/ppm.c View File

@@ -55,14 +55,15 @@ rwpipe *rwpipe_open( int argc, char *argv[] )

if ( this->pid == 0 )
{
char *command = av_mallocz( 10240 );
#define COMMAND_SIZE 10240
char *command = av_mallocz( COMMAND_SIZE );
int i;

strcpy( command, "" );
for ( i = 0; i < argc; i ++ )
{
strcat( command, argv[ i ] );
strcat( command, " " );
pstrcat( command, COMMAND_SIZE, argv[ i ] );
pstrcat( command, COMMAND_SIZE, " " );
}

dup2( output[ 0 ], STDIN_FILENO );


Loading…
Cancel
Save