Wasn't checking the range of the device id in cdio_have_driver. Add regression test for checking this too.

More git administrivia.
This commit is contained in:
R. Bernstein
2008-12-06 21:20:51 -05:00
parent f434186567
commit 542481d673
7 changed files with 141 additions and 5 deletions

View File

@@ -857,6 +857,9 @@ cdio_have_atapi(CdIo_t *p_cdio)
bool
cdio_have_driver(driver_id_t driver_id)
{
if (driver_id < CDIO_MIN_DRIVER ||
driver_id > CDIO_MAX_DRIVER)
return false;
return (*CdIo_all_drivers[driver_id].have_driver)();
}