Commit a0b8b3e4 authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Jean-Baptiste Kempf

Fix possible buffer overflow

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 2b77f469
...@@ -498,8 +498,9 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath, ...@@ -498,8 +498,9 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath,
} }
if(path_copy[0] == '\0') { if(path_copy[0] == '\0') {
path_copy[0] = '/'; free( path_copy );
path_copy[1] = '\0'; if( !(path_copy = strdup( "/" ) ) )
goto DVDOpen_error;
} }
#if defined(__APPLE__) #if defined(__APPLE__)
......
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