cdrom_id: do not attempt to read past end of buffer

CID #1238437
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2014-10-27 21:52:38 -04:00
parent dec23413ec
commit 3fcd09602c
1 changed files with 1 additions and 1 deletions

View File

@ -606,7 +606,7 @@ static int cd_profiles(struct udev *udev, int fd)
switch (feature) {
case 0x00:
log_debug("GET CONFIGURATION: feature 'profiles', with %i entries", features[i+3] / 4);
feature_profiles(udev, &features[i]+4, features[i+3]);
feature_profiles(udev, &features[i]+4, MIN(features[i+3], len - i - 4));
break;
default:
log_debug("GET CONFIGURATION: feature 0x%04x <ignored>, with 0x%02x bytes", feature, features[i+3]);