summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-08-15 10:00:33 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-05 13:09:44 +0200
commite6bc6e2c0d1f87f64adf4fbf7594d2164e0d7bc8 (patch)
treef0db640b37248f5fd174b929c0d0297e1bb9e01c /drivers/media
parent4a2cb7600b72ff0eda483d97a24b29c3959efdfa (diff)
downloadlinux-stable-e6bc6e2c0d1f87f64adf4fbf7594d2164e0d7bc8.tar.gz
linux-stable-e6bc6e2c0d1f87f64adf4fbf7594d2164e0d7bc8.tar.bz2
linux-stable-e6bc6e2c0d1f87f64adf4fbf7594d2164e0d7bc8.zip
media: hdpvr: add terminating 0 at end of string
[ Upstream commit 8b8900b729e4f31f12ac1127bde137c775c327e6 ] dev->usbc_buf was passed as argument for %s, but it was not safeguarded by a terminating 0. This caused this syzbot issue: https://syzkaller.appspot.com/bug?extid=79d18aac4bf1770dd050 Reported-and-tested-by: syzbot+79d18aac4bf1770dd050@syzkaller.appspotmail.com Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index 46adee95f89d..3316a17c141b 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -141,6 +141,7 @@ static int device_authorization(struct hdpvr_device *dev)
dev->fw_ver = dev->usbc_buf[1];
+ dev->usbc_buf[46] = '\0';
v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",
dev->fw_ver, &dev->usbc_buf[2]);