summaryrefslogtreecommitdiffstats
path: root/src/udev/cdrom_id
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-28 02:52:38 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-10-28 03:30:43 +0100
commit3fcd09602c0dfff8c0fafe6c4f9bba6b0fd72c30 (patch)
treec9d13b65dbb4c0b5c2b387a5fd57141b76dbcf1f /src/udev/cdrom_id
parentselinux: make sure we do not try to print missing fields (diff)
downloadsystemd-3fcd09602c0dfff8c0fafe6c4f9bba6b0fd72c30.tar.xz
systemd-3fcd09602c0dfff8c0fafe6c4f9bba6b0fd72c30.zip
cdrom_id: do not attempt to read past end of buffer
CID #1238437
Diffstat (limited to 'src/udev/cdrom_id')
-rw-r--r--src/udev/cdrom_id/cdrom_id.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c
index c93a7bf8d1..7a4b98726c 100644
--- a/src/udev/cdrom_id/cdrom_id.c
+++ b/src/udev/cdrom_id/cdrom_id.c
@@ -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]);