Commit 981589fd authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix minor overflow bug

parent 9a957000
...@@ -422,7 +422,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name, ...@@ -422,7 +422,7 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
module_t *p_parser; module_t *p_parser;
FILE *file; FILE *file;
char p_line[1024], *p_index2; char p_line[1024], *p_index2;
int i_sizebuf = 0; unsigned long i_sizebuf = 0;
char *p_bigbuffer, *p_index; char *p_bigbuffer, *p_index;
bool b_backup; bool b_backup;
int i_index; int i_index;
...@@ -444,6 +444,8 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name, ...@@ -444,6 +444,8 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
fseek( file, 0L, SEEK_END ); fseek( file, 0L, SEEK_END );
i_sizebuf = ftell( file ); i_sizebuf = ftell( file );
fseek( file, 0L, SEEK_SET ); fseek( file, 0L, SEEK_SET );
if( i_sizebuf >= LONG_MAX )
i_sizebuf = 0;
} }
p_bigbuffer = p_index = malloc( i_sizebuf+1 ); p_bigbuffer = p_index = malloc( i_sizebuf+1 );
......
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