Opened 17 years ago
Closed 17 years ago
#4838 closed defect (fixed)
make sure dvdcss_version always has something in it. Even if it isn't found.
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | minor | Milestone: | 0.22 |
Component: | mythtv | Version: | 0.21-fixes |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
The dvdcss_version string is extracted from the shared library. It might fail if the symbol is not found. That is fine. But in the code:
if(dvdcss_library != NULL) { /* char *psz_method = getenv( "DVDCSS_METHOD" ); char *psz_verbose = getenv( "DVDCSS_VERBOSE" ); fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method); fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose); */ fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n", *dvdcss_version);
The dvdcss_version string might point to null and then printed out. Which wouldn't crash. But would be garbage.
Attachments (1)
Change History (5)
Changed 17 years ago by
Attachment: | libs_libmythdvdnav_dvd_input.c-make-sure-dvd_version-exists.patch added |
---|
comment:1 Changed 17 years ago by
Milestone: | 0.21 → 0.22 |
---|
comment:2 Changed 17 years ago by
Close, but dvdcss_version is a pointer to a char pointer. I think something like this is needed:
% svn diff libs/libmythdvdnav/dvd_input.c Index: libs/libmythdvdnav/dvd_input.c =================================================================== --- libs/libmythdvdnav/dvd_input.c (revision 16344) +++ libs/libmythdvdnav/dvd_input.c (working copy) @@ -343,7 +343,7 @@ fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose); */ fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n", - *dvdcss_version); + dvdcss_version ? *dvdcss_version : "unknown"); /* libdvdcss wrapper functions */ dvdinput_open = css_open;
Note: See
TracTickets for help on using
tickets.
make sure dvdcss_version is set to something.