diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-10-27 21:52:38 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-10-28 20:48:28 -0400 |
commit | 86392f7d55c283a7f45253eefe2434e3f5afd7b3 (patch) | |
tree | 983b6ea96214c789102c3a55f657e7f8d38c6886 /src/cdrom_id/cdrom_id.c | |
parent | 905473a866c82fb97f02a60bad1ae2ab637cadb4 (diff) |
cdrom_id: do not attempt to read past end of buffer
CID #1238437
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/cdrom_id/cdrom_id.c')
-rw-r--r-- | src/cdrom_id/cdrom_id.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cdrom_id/cdrom_id.c b/src/cdrom_id/cdrom_id.c index 4d0e6e073a..9b3ab7021e 100644 --- a/src/cdrom_id/cdrom_id.c +++ b/src/cdrom_id/cdrom_id.c @@ -610,7 +610,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]); |