[libdvdnav-devel] [PATCH 2/7] Fix possible buffer overflow
Petri Hintukainen
phintuka at gmail.com
Wed May 20 12:41:01 CEST 2015
---
src/dvd_reader.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/dvd_reader.c b/src/dvd_reader.c
index cd65e7d..005d90b 100644
--- a/src/dvd_reader.c
+++ b/src/dvd_reader.c
@@ -498,8 +498,9 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath,
}
if(path_copy[0] == '\0') {
- path_copy[0] = '/';
- path_copy[1] = '\0';
+ free( path_copy );
+ if( !(path_copy = strdup( "/" ) ) )
+ goto DVDOpen_error;
}
#if defined(__APPLE__)
--
2.1.4
More information about the libdvdnav-devel
mailing list